Answered step by step
Verified Expert Solution
Question
1 Approved Answer
can't fix my code please help! A health club currently charges $250.50 per year for membership. It has announced that it will increase its membership
can't fix my code please help!
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. When your programs input is as shown in Figure 1. your program should produce the output as shown in Figure 2. Figure 1: (input) 7 Figure 2 (output) Charges 2 3 250.50 255.51 260.62 265.83 271.15 276.57 282.10 287.75 5 1 // Ryan Dewey 2 // CS 1336. DMI 3/7 Lab 29 5 #include
Step 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