to become a member of a fitness center is as follows: (a) the senior The cost ci
ID: 3747316 • Letter: T
Question
to become a member of a fitness center is as follows: (a) the senior The cost citizens discount is 30% (b) if the membership is bought and paid for 12 or more months, the discount is 15%; and (c) if more than five personal training sessions are bought and paid for, the discount on each session is 20%. Write a menu-driven program Your program must contain a function that displays the general information about the fitness center and information to determine the membership cost, and a function to determine the membership cost. Use appropriate parameters to pass information in and that determines the cost of a new membership its charges, a function to get all of the necessary out of a function. (Do not use any global variables.) Cost ol mambership on)br discount-30% ought lat months-15%Explanation / Answer
/* please modify your mon_cost() function because you cannot add session cost in total cost
If you have any problem please comment */
double mon_cost(int mem_month,int train_ses,char senior,double mon_cost1,double tr_ses_cost)
{
double cost = 0.0;
// calculate monthly cost
if (mem_month < 12)
cost = mem_month * mon_cost1;
else
cost = (mem_month * mon_cost1) * (1 - TWELVE_OR_MORE_MONTH_MEM_DIS);
// if senior citizen give dicount else not
if (senior == 'y' || senior == 'Y')
cost = cost * (1 - SENIOR_CITIZEN_DIS);
//add training session cost and monthly cost
if (train_ses >= 6)
cost =(train_ses*tr_ses_cost) + cost * (1 - SIX_OR_MORE_PERSONAL_TE_SESSIONS_DIS);
else
cost = cost +(train_ses*tr_ses_cost);
return cost;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.