Question: Written in C++: Write a program that has two parts to demonstrate different types of loops in this language. The first part should ask for
Written in C++:
Write a program that has two parts to demonstrate different types of loops in this language. The first part should ask for an unlimited number of quantities from the user one at a time. Use a while loop or do while loop [your choice] to ask the user for the next number over and over until they give you -1 as value to stop the loop. This loops should add all the numbers the user entered in this indefinite loop together and print out the total to the user afterwards. The second part should have a counter controlled loop (while loop or for loop it is up to you) that cycles 10 times. It should ask the user for a starting value in a bank account. It should then print a table of the balance of that bank account for each year by printing the value on a line. Have the bank account apply interest of 3% per year. Finally, show the bank account on each line to two decimal places of formatting (so 150.5555 shows as 150.56) to demonstrate formatting in this language [Heads up - It doesn't matter if you apply the interest before or afterwards each year for the grade on the second part. This assignment is on loops and formatting. That's what's being graded here not the compounding interest day of the year which isn't given.]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
