CSE 1020 - Programming test 1

Phase 1

Present the user with the following prompt.
The amount to be invested:
The entry has to be made on the next line.

Phase 2

Next, expand your program to read the entered amount. You may assume that the user always enters a positive integer.

Here is a sample run (including the integer entered by the user):

The amount to be invested: 
455

Phase 3

Next, expand your program to print the amount of interest. To determine the amount of interest, you have to use the class Interest, whose API can be found here. Print the value using two digits of precision.

Here is a sample run (including the output and input of the earlier phases as well):

The amount to be invested: 
455
The amount of interest: 15.72

Phase 4

Next, determine the amount of interest for the given amount based on the base rate. Again, you have to use the class Interest. Use two digits of precision.

Here is a sample run (including the output and input of the earlier phases as well):

The amount to be invested: 
455
The amount of interest: 15.72
The amount of interest (based on the base rate): 15.72

Phase 5

Finally, determine whether there is any difference between the amounts of interest that you already computed. Use two digits of precision when you compare the amounts.

Here is a sample run (including the output and input of the earlier phases as well):

The amount to be invested: 
455
The amount of interest: 15.72
The amount of interest (based on the base rate): 15.72
Are the amounts the same? true

Here is another sample run (including the output and input of the earlier phases as well):

The amount to be invested: 
1111
The amount of interest: 116.31
The amount of interest (based on the base rate): 38.40
Are the amounts the same? false