Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The cost to become a member of a fitness center is as follows: the senior citize

ID: 3679066 • Letter: T

Question

The cost to become a member of a fitness center is as follows: the senior citizens discount is 30%; if the membership is bought and paid for 12 or more months, the discount is 15%; if more than five personal training sessions are bought and paid for, the discount on each session is 20%. Write a menu-driven program that determines the cost of a new membership. Your program must contain a function that displays the general information about the fitness center and its charges, a function to get all of the necessary information to determine the membership cost, and a function to determine the membership cost. Use appropriate parameters to pass information in and out of a function. (Do not use any global variables.)

Explanation / Answer

#include<iostream>
#include<stdlib.h>
void information();
void requirements();
void Caluclatecost();
void Caluclatecost(char,char,int);
int main()
{
int s;

information(); //displays the information.
requirements();//requirements to caluclate cost.
std::cin>>s;
return 0;   
}
void information()
{
std::cout<<"Information about the fitness center ";
std::cout<<"Senior citizenshi discount is 30 percent. ";
std::cout<<"If the membership is brought and paid for 12 months the discount is 15% ";
std::cout<<"if more than 5 sessions are brought then discount on each session is 20% ";
}
void requirements()
{
char citizen,member;
int sessions;
std::cout<<"Are you a senior citizon enter y if yes else n ";
std::cin>>citizen;
std::cout<<"Have you brought membership and willing to pay for 12 months? enter y if yes else n ";
std::cin>>member;
std::cout<<"how many sessions you are taking ";
std::cin>>sessions;
Caluclatecost(citizen,member,sessions);

}
void Caluclatecost(char citizen,char member,int sessions)
{
//let us consider each session costs 1000 rupies.
int cost=1000;
if(citizen=='y')
cost=cost-((cost*30)/100);
if(member=='y')
cost=cost-((cost*15)/100);
if(sessions>5)
cost=(cost-((cost*20)/100))*sessions;
else
cost=(cost*sessions);

std::cout<<"total money you have to pay is "<<cost;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote