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 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.
input code:

output:

code:
#include <bits/stdc++.h>
using namespace std;
int main()
{
/*in this code i calculate increasing gym fees rate 2% of running
year
not the previous year means after 1st year 2nd year rate will
calculate as
secondyear_rate= firstyear_rate + 2% of firstyear_rate
thirdyear_rate= secondyear_rate + 2% of secondyear_rate*/
/*declare array for store the value*/
double increase_rates[3],rate=600;
/*compute the next three year gym membership fees*/
for(int i=0;i<3;i++)
{
/*increase fees 2% of that year*/
increase_rates[i]=rate+rate*0.02;
/*store that new year gym fees into rate */
rate=increase_rates[i];
}
/*write a loop for print the next 3 year Gym fees*/
for(int j=0;j<3;j++)
{
/*print the output*/
cout<<"Gym membership fees after "<<(j+1);
cout<<"th year is :
$"<<increase_rates[j]<<endl;
}
return 0;
}
In this module you learned about making loops in C++ and how to combine them with...
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...
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...
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...
In this module, you learned about Arrays in C++ and how to implement arrays within your C++ programs. For this assignment, you will implement your knowledge of arrays for Michigan Popcorn Company’s sales management system. Write a program that lets the Michigan Popcorn Company keep track of their sales for seven different types of popcorn they produce: plain, butter, caramel, cheese, chocolate, turtle and zebra. It should use two parallel seven-element arrays: an array of strings that holds the seven...
For this assignment, you will apply what you learned in analyzing for, while, and do-while loops by writing these statements yourself. The Java™ program you write should do the following: Display a pyramid of asterisks onscreen (i.e., a nested for loop) Display the integers 10 to 1 in decreasing order, one number per line (i.e., a while/do-whlie loop) Add 7 until the sum becomes greater than 157, at which point the program should display both the sum and the number...
Write them in python IDLE *****
5. Average Rainfall
Write a program that uses nested loops to collect data
and calculate the average rainfall over a period of years. The
program should first ask for the number of years. The outer loop
will iterate once for each year. The inner loop will iterate twelve
times, once for each month. Each iteration of the inner loop will
ask the user for the inches of rainfall for that month. After all
iterations,...
(**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...
Lab 5 Instructions For Lab 5, you will be writing a more complex modular program that uses at least two arrays, and has at least one loop that accesses the data in the arrays. As long as your program satisfies the requirements listed below, you are free to design and write any type of program that you care to. You are encouraged to be creative, and pick something that has meaning for you, because you'll have more fun. Feel free...
In this module you learned about arrays. You also began learning about implementing arrays and how they can help organize the data in a program. The magic ball eight was created in the 50's and was produced by mattel. Eight Ball is a toy and is just a game. The magic 8 ball answers your yes/no questions. You will be creating a version of the Magic 8 Ball game. You can use whats inside the attached file to build your...
You are now allowed to use the following in additional to the techniques of the previous chapters: • for loops • math.h and pow() function • formatting float and double numbers • switch statements getchar() function • ASCII chart • do...while loops • break and continue statements • Logical AND (&&), logical OR (||), logical NOT (!) operators • Work on format style!!! Points may be deducted for code that is not properly styled. Q5: (World Population Growth) (20 points)...