Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm not sure how to do the calculation. I need amount = principal * (1+rate/t)^t please help! Assuming there are no deposits other than the

I'm not sure how to do the calculation. I need amount = principal * (1+rate/t)^t

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

please help!

Assuming there are no deposits other than the original investment, the balance in a savings account after one year may be calculated as: T amount = principal (1 + rate)" Where principal = original balance in the account rate = interest rate T= number of times the interest is compounded during a year (T is 4 if the interest is compounded quarterly) Program Requirements: Incorporate the use of good comments Incorporate self-documenting variable names (T is not a good variable name for the number of times the interest is compounded) Variables for principal and the interest rate should be of type double and the number of times the interest is compounded should be of type int Read in the principal, the interest rate, and the number of times the interest is compounded in that order Compute the new amount in the savings account using the above formula o Hint: Look at slide 4 of CS1336_Lect3d_Math_expressions.pptx for an example of the pow () function. Display the interest rate, times compounded principal, interest, and current amount in the account as specified. When the input is as shown in Figure 1, the output should appear as shown in Figure 2. There are 8 dashes on either side of the "Interest Earned" string literal . Output the remaining string literals left-justified in a field width of 20 followed by a space or dollar sign as appropriate (use left 6 #include 7 using namespace std; 8 9 int main() 10 { 12 13 14 15 16 // variable defintions double principal, amount, rate int timesCompounded; //read in data in specified order cin >> principal >> rate >> timesCompunded; //calcuate the amount in the account after one year amount = principal *1 18 19 20 21 22 23 24 25 26 //output cout > principal >> rate >> timesCompunded; 18 19 //calcuate the amount in the account after one year amount = principal | TE //output cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. Who will you assemble on the team?

Answered: 1 week ago

Question

Did the team members feel that their work mattered

Answered: 1 week ago