Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ please!! Use PRECISELY the format below with the EXACT same SPACING. Please enter the initial balance: Please enter the interest rate : Please enter
C++ please!!
Use PRECISELY the format below with the EXACT same SPACING. Please enter the initial balance: Please enter the interest rate : Please enter the number of years: OUTPUT SPECIFICATION Output an introductory message, prompts, and then the table. The sample output below assumes in the of 1000, an interest rate of 6.50, and a number of years of 10. Note well the FORMATTING (spacing and justification) used. You may assume numbers will not overflow their columns. This program will calculate the interest earned on a CD over a period of several years. Please enter the initial balance: 1000 Please enter the interest rate : 6.5 Please enter the number of years: 10 \begin{tabular}{lrrr} Year & Balance & Interest & New Balance \\ \hline1 & 1,000.00 & 65.00 & 1,065.00 \\ 1 & 1,065.00 & 69.23 & 1,134.23 \end{tabular} Include at LEAST the following methods. // Inform user what program will do void printintro (); // Print the header followed by all the rows, void printTable (int numRows, double balance, double rate); // Print one row of table, "interest" is a dollar amount, // not a rate. void printRow (int rownum, double balance, double interest); // Calculate interest given a balance and percentage rate (like 7.2\%) double calcinterest (double balance, double rate); HINTS Do NOT worry about formatting the table until you get the logic correct. Once you do get the logic correct, use to format the four table columns (Year, Balance, Interest, and New Balance). You may find this StackOverflow question useful. It involves setlocale() and using an apostrophe. Set the locale ONLY ONCE, and do so in main(). Note that if you're using a nonlab machine your program may behave differently, so ensure you test thoroughly on a Linux Lab machine before submitting. Depending on your system's implementation of printf, some of your amounts may differ from mine by a cent. The following width guide may be of useStep 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