Question

This is for an intro to C++ class, and this module is an introduction to looping...

This is for an intro to C++ class, and this module is an introduction to looping for C++. If you have any additional question please let me know.

"For this assignment, you will write a program that calculates a rate increase for a gym membership. Consider the following scenario:

A gym membership, which currently charges $600 per year for membership, has announced that it will increase its membership fee by 2 percent each year for the next three years.

Write a program that uses a loop to display the projected rates for the next three years. Be sure to include comments throughout your code where appropriate."

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <iostream>
using namespace std;

int main()
{
float currentcharge = 600; //assign the current membership fee value to 600;
cout<<"\nCurrent membership fee is: "<<currentcharge; //print the current value
int i;
//loop the process for three years to calculate it's value for next 3 years.
for(i=1;i<=3;i++)
{
currentcharge = currentcharge*1.02;
//we are multiplying with 1.02 because we are
//increasing the value by 2% which means currentcharge*(1+2/100)
//which is currentcharge(1+0.02) which is currentcharge(1.02)
cout<<"\nMembership fee for year "<<i<<" is: "<<currentcharge; //print the value
}
return 0;
}

OUTPUT:

Add a comment
Know the answer?
Add Answer to:
This is for an intro to C++ class, and this module is an introduction to looping...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In this module you learned about making loops in C++ and how to combine them with...

    In this module you learned about making loops in C++ and how to combine them with the material from the first few modules to solve problems. For this assignment, you will write a C++ program that calculates a rate increase for a gym membership. Consider the following scenario: A gym membership, which currently charges $600 per year for membership, has announced that it will increase its membership fee by 2 percent each year for the next three years. Write a...

  • This project is for my intro to C++ class. Below is the wording for the project....

    This project is for my intro to C++ class. Below is the wording for the project. "In this module, you learned about creating functions in C++ and how to combine functions with the concepts covered in previous modules to solve problems. For this assignment you will create a program converting Fahrenheit temperatures to Celsius temperatures. The formula for converting a temperature from Celsius to Fahrenheit is: F = C x 1.8 + 32, where F is the Fahrenheit temperature and...

  • In this module you learned more detail about C++ syntax including, variables, literals, data types, programming...

    In this module you learned more detail about C++ syntax including, variables, literals, data types, programming style and how to tie all of these together to solve problems. For this assignment, write a program that calculates a grocery bill. The program should output “Joe’s Market” as the title. The program should prompt the user to enter the price for five products of your choosing. The program should calculate the total price of the groceries, add 6% sales tax to the...

  • Write the pseudocode. At one college, the tuition for a full-time student is $6,000 per semester....

    Write the pseudocode. At one college, the tuition for a full-time student is $6,000 per semester. It has been announced that the tuition will increase by 2 percent each year for the next five years. Design a program with a loop that displays the projected semester tuition amount for the next five years.

  • (**IN PYTHON**) In 2019, the tuition for a full time student is $7,180 per semester. The...

    (**IN PYTHON**) In 2019, the tuition for a full time student is $7,180 per semester. The tuition will be going up for the next 7 years at a rate of 3.5% per year. Write your program using a loop that displays the projected semester tuition for the next 7 years. You may NOT hard code each years tuition into your program. Your program should calculate the tuition for each year given the starting tuition in 2019 ($7, 180) and the...

  • COP2860 - Introduction to C# Programming Module #5 Assignment 10 points Program Functionality: Create a C#.NET...

    COP2860 - Introduction to C# Programming Module #5 Assignment 10 points Program Functionality: Create a C#.NET program that calculates customer bills for a food truck: Assignment Requirements: Build a custom order pad for a burger truck. It should look roughly like the following: Customer Bill - OX Bob's Burgers cheese fried egg bacon avocado O rare medium well done O yes no payment? O cash credit total clear Customer Bill - 0x Bob's Burgers cheese fried egg bacon avocado Add...

  • Write a C++ program that uses: .selection constructs (if, if else, and switch) .multiway branches .looping...

    Write a C++ program that uses: .selection constructs (if, if else, and switch) .multiway branches .looping constructs (do and while loops) .Boolean expressions, bool and char types. 1. Develop a program that calculates charges for an Internet provider. The cost is determined by the amount of data used and the consumer plan. Package B (basic) is the most affordable if you plan on using < 20GB (20,000MB), however, if you consume more than 20GB (20,000MB) you are charged for each...

  • This is an Introduction to Programming Course It is in Python 3. At one college, the...

    This is an Introduction to Programming Course It is in Python 3. At one college, the tuition for a full-time student is $8,000 per semester. It has been announced that the tuition will increase by 3 percent each year for the next 5 years. Write a program with a loop that displays the projected semester tuition amount for the next 5 years. The program should print out the result in the form: In 1 year, the tuition will be $8240.0....

  • Python, please help At one college, the tuition for a full-time student is $8,000 per semester....

    Python, please help At one college, the tuition for a full-time student is $8,000 per semester. It has been announced that the tuition will increase by 3 percent each year for the next 5 years. Write a program with a loop that displays the projected semester tuition amount for the next 5 years. The program should print out the result in the form In 1 year, the tuition will be $8002.3. In 2 years, the tuition will be $8103.2. In...

  • In this module you learned about Object-Oriented programming in C++ and how to combine this approach...

    In this module you learned about Object-Oriented programming in C++ and how to combine this approach with the concepts covered in previous modules For this assignment you will write a class called Dog that has the following member variables: birthyear. An int that holds the dog’s birth year. breed. A string that holds the breed of dog. vaccines. A Boolean holding a yes/no value indicating whether the dog is currently on vaccinations. In addition, the class should have the following...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT