Here are my assignments

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Er45Yu
    New Member
    • Feb 2008
    • 3

    Here are my assignments

    please can you tell me how do you convert it to the codes.

    Write a Java program called MaxMin that prompts the user to enter three integers. The program finds the minimum and maximum values that were entered, and prints the result. Here is an example of the output produced by such a program:

    Enter three integers: 17 2 2439
    The minimum value is 2
    The maximum value is 2439

    When you are using the Scanner class and its nextInt method, the method looks for either a space or a newline character to indicate the end of an integer input. Thus you can enter all three integers on one line, and call the nextInt method three times to get the input values. Alternatively, the user can press "Enter" after each integer.

    Write a Java program that displays the growth in value of an investment over a number of years. The investment pays a fixed interest rate. Interest is calculated once a year. The interest is compounded -- i.e. in the second year, the interest is calculated not only on the initial amount, but also on the interest that was paid in the first year. The program should prompt the user to enter the initial value of the investment (called the principal), the annual interest rate in percent, and the number of years (callled the term). It then displays a table with two columns, with a heading for each column, and showing the value of the investment after each year.
    For example:

    Enter the principal, in dollars and cents: 1000.00
    Enter the annual interest rate, in percent: 4.5
    Enter the term, in years: 5



    Years Value of Investment
    ----- -------------------
    0 1000.00
    1 1045.00
    2 1092.03
    3 1141.17
    4 1192.52
    5 1246.18

    You do not need to use any complicated mathematical formulas; you can solve this problem using simple addition and multiplication. Call your class InvestmentValue .

    Pay attention to coding conventions such as alignment of braces, upper- and lower-case letters in names, indentation, and white space around operators.
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

    Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.

    Then when you are ready post a new question in this thread.

    MODERATOR

    Comment

    • BigDaddyLH
      Recognized Expert Top Contributor
      • Dec 2007
      • 1216

      #3
      Please remember to provide a meaningful Title for any threads started (see the FAQ entry Use a Good Thread Title).

      This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.

      MODERATOR

      Comment

      Working...