Question
C++ Write a program that repeatedly asks for the principal, the interest rate (Rate), and the number of times (T) the interest is compounded on
C++
Write a program that repeatedly asks for the principal, the interest rate (Rate), and the number of times (T) the interest is compounded on a montly basis and outputs the amount in savings. Use the following formula.
Amount in Savings = Principal * (1 + Rate/T)T*(T/12.0)
Note that you can compute something raised to a power, for example, baseexponent using:
#include < math.h > or #include
Also note that rate is input as a percent, but the formula assumes it is between 0 and 1, so divide the percent by 100. The output need to be in this format: Enter principal: 1000 Enter interest rate (as percent): 4.25 Enter number of times compounded: 12 Interest Rate: 4.25% Times Compounded: 12 Principal: $ 1000.00 Amount in Savings: $ 1043.34 IMPORTANT: The purpose of this problem is output formatting. Not following the formatting shown will not receive full credit. Hard coding the formatting so that it only works for particular inputs will not receive full credit.
Here is the complete list of requirements for code:
-
Good style: Use proper indentation and good naming conventions.
-
Usability: Always prompt the user for input so they know what to do and provide meaningful output messages.
-
Input Validation: The program should not accept invalid input, prompt the user to reenter an input that is invalid.
-
Documentation: Add a comments that document what each part of your code does. Name/date/e-mail and program overview at the top of the document.
-
Testing: Don't submit your solution until you have tested it. The code must compile, execute and produce the correct output for any input. Put your testing information including the input data you tried and the result that you expected and showed at the end of your program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started