Question: int ComputeComoundInterestYearly(int principal, float rate, int years); compute interest and return the amount based on initial investment (principal) and yearly rate and how many years.

int ComputeComoundInterestYearly(int principal, float rate, int years); compute interest and return the amount based on initial investment (principal) and yearly rate and how many years.

Use the above version to compute the total (principal plus interest) after 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10 years for an amount 10,000. Then print the total for the 10 years in row with proper heading for each column as following:

Principal Year_1 Year_2 Year_3 Year_4 Year_5 Year_6 Year_7 Year_8 Year_9 Year_10

3-Do the above for principal amounts 10,000, 15,000, and 20,000. The end printing result should be a table with the above headings and 3 rows for each principal. Make sure to use std::setw formatting to properly format the output, so that all columns are nicely aligned to the same offset. Try different column distance and choose the one that looks nicely aligned consistently for all columns.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!