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...

  • 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.

  • 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....

  • M01 PA C++ Classes and Objects INTRODUCTION: Write a C++ program that implements and utilizes a...

    M01 PA C++ Classes and Objects INTRODUCTION: Write a C++ program that implements and utilizes a Stereo Receiver Class/Object. INCLUDE IN YOUR ASSIGNMENT At the top of each of your C++ programs, you should have at least four lines of documentation: Program name (the C++ file name(s)), Author (your name), Date last updated, and Purpose (a brief description of what the program accomplishes). Here is an example: // Program name: tictactoe.cpp // Author: Rainbow Dash // Date last updated: 5/26/2016...

  • CT143 : Intro to C++ Lab 15: Array Practice Instructions Complete each of the C++ activities...

    CT143 : Intro to C++ Lab 15: Array Practice Instructions Complete each of the C++ activities described below in a single source file Label each activity with its own heading using comments. Activities: 1) Favorite numbers a. Declare and initialize an array of 10 integers as a single statement using a name of your choice. b. Output the result of adding the 1st and 5th members of the array. C. Subtract the 4h member from 3 times the 10th member...

  • 5.41 exercise Visual C#:How to Program (World Population Growth) World population has grown considerably over the...

    5.41 exercise Visual C#:How to Program (World Population Growth) World population has grown considerably over the centuries. Continued growth could eventually challenge the limits of breathable air, drinkable water, arable cropland and other limited resources. There's evidence that growth has been slowing in recent years and that world population could peak sometime this century, then start to decline. For this exercise, research world population growth issues online. Be sure to investigate various viewpoints. Get estimates for the current world population...

  • C++ The No Interest Credit Company provides zero-interest loans to customers. (It makes a profit by...

    C++ The No Interest Credit Company provides zero-interest loans to customers. (It makes a profit by selling advertising space in its monthly statements and selling its customer lists.) Design an application that gets customer account data that includes an account number, customer name, and balance due. For each customer, display the account number and name; then print the customer's projected balance each month for the next 10 months. Assume that there is no finance charge on this account, that the...

  • C PROGRAMMING Introduction In this part, you will solve a problem described in English. Although you...

    C PROGRAMMING Introduction In this part, you will solve a problem described in English. Although you may discuss ideas with your classmates, etc., everyone must write and submit their own version of the program. Do NOT use anyone else’s code, as this will result in a zero for you and the other person! Shipping Calculator Speedy Shipping Company will ship your package based on the weight and how far you are sending the package, which can be anywhere in the...

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
ADVERTISEMENT