Answered step by step
Verified Expert Solution
Question
1 Approved Answer
i can't figure out what is wrong with my code it outputs the way it's supposed to in the display but when i go to
i can't figure out what is wrong with my code it outputs the way it's supposed to in the display but when i go to submit my work it tells me i didn't indent properly any help??
C++ please
A health club currently charges $250.50 per year for membership. It has announced that it will increase its membership fee by 2% each year. Assume the user has been asked to enter the number of additional years they plan to keep their membership. Your program should read in that value and then output the membership fee for each year, beginning with the current year and ending with the last year of their membership. Generate the output in a table as shown below. Use a do-while loop to display the year and the membership fee for that year, beginning with the current year. Use integer variables and start at year =0 for the current year. Hint 1: Create a double variable charges and initialize it with the first year membership fee. Inside the loop, update charges by 2%. Hint 2: Use setprecision (2), fixed and setw () options. Hint 3: There are 13 dashes in the table. Hint 4: Output the year in a field width of 6 and the charges in a field width of 7. When your program's input is as shown in Figure 1, your program should produce the output as shown in Figure 2. Figure 1: (input) Figure 2: (output) 457266.2740000.qx3zqy 7 5.4.1: Lab 29: Membership Fees 0/10 main.cpp Load default template... Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box. Enter program input (optional) 7 Input (from above) Output (shown below) Program output displayed here 1:Compare output 0/5 Output differs. See highlights below. Special character legend Input 5 Years Charges 0250.50 1255.51 Your output 2260.623265.834271.155276.57 Expected output \begin{tabular}{lr} Year & Charges \\ \hline0.00 \\ 0 & 250.50 \\ 1 & 255.51 \\ 2 & 260.62 \\ 3 & 265.83 \\ 4 & 271.15 \\ 5 & 276.57 \\ \hline \end{tabular} 2:Compare output 0/5Step 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