2010 Homework #3

I looked at the menu.cpp programs. More than half had goto statements. This is not allowed in our homeworks. If you want a score on this homework, you must now do this: 1. Remove all goto statements. 2. Remove all switch statements. 3. Remove all looping of any kind. 4. Do not ask for any user input prior to menu input. The user will choose one menu item, it will run, then the program will end. This will be due during week-5. Please do not go to the Internet and search for solutions to assignments.

The programs below are from Textbook Chapter-3.

Choose 1 program below and add it to your lab-3 menu program.
Add it as a menu item and integrate it into the menu program.

Start with your /2010/3/menu.cpp program.

Also, choose one more program from Textbook Chapter-4 and add it to your menu.cpp program. The program you choose must be from the "Programming Challenges" section of chapter-4 in the Gaddis textbook. You must indicate in the code and on-screen which challenge you have chosen from chapter #4.

Choose one of these program ideas:

#18. Interest Earned

Assuming there are no deposits other than the original investment,
the balance in a savings account after one year may be calculated as

                           Rate
Amount = Principal * (1 + ------ ) ^ T
                            T

Principal is the balance in the savings account, Rate is the interest rate,
and T is the number of times the interest is compounded during a year
(T is 4 if the interest is compounded quarterly).

Write a program that asks for the principal, the interest rate, and the
number of times the interest is compounded. It should display a report
similar to

   Interest Rate:             4.25%
   Times Compounded:            12
   Principal:            $ 1000.00
   Interest:             $   43.34
   Amount in Savings:    $ 1043.34

#19. Monthly Payments

The monthly payment on a loan may be calculated by the following formula:

           Rate * (1 + Rate) ^ N
Payment =  ---------------------  * L
            ((1 + Rate)^N - 1)

Rate is the monthly interest rate, which is the annual interest rate divided
by 12. (12% annual interest would be 1 percent monthly interest.) N is the
number of payments, and L is the amount of the loan. Write a program that
asks for these values and displays a report similar to

Loan Amount:              $ 10000.00
Monthly Interest Rate:             1%
Number of Payments:               36
Monthly Payment:          $   332.14
Amount Paid Back:         $ 11957.15
Interest Paid:            $  1957.15

Notes:

The ^ symbol means raised to a power. You should use the pow() function call.

Look in your book for a clear explanation of these problems.