C++ Homework,
The cost to become a member of a fitness center is as follows:
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 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.)
`Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
//header files
#include<iostream>
#include<iomanip>
//namespace
using namespace std;
//this function display the general information
void display_info()
{
//display the information
cout<<"******Welcome to ABC Fitness Center*****"<<endl;
cout<<endl;
cout<<"Membership Cost is $20."<<endl;
cout<<"Personal training fees is $25 for each session."<<endl;
cout<<"The senior citizen discount is: 30%."<<endl;
cout<<"If membership bought and paid for 12 months or more , the discount is 15%."<<endl;
cout<<"If more than five personal training sessions are bought and paid for, the discount on each session is 20%."<<endl;
cout<<endl;
}
//this function accept the details from the members
void get_details(int &category, int &months, char &ans)
{
//accept details
cout<<"Please Select your category..."<<endl;
cout<<"1.Youth"<<endl;
cout<<"2.Senior Citizen"<<endl;
cin>>category;
cout<<"Enter the membership months: ";
cin>>months;
cout<<"Do you want to avail personal training sessions y/n: "<<endl;
cin>>ans;
}
//this function determine the membership cost depend on member data
double get_membership_cost(int category,int months,char ans)
{
double cost;
int p_sessions;
if(category == 1 && months < 12 && ans == 'n' || ans == 'N')
{
cost = 20;
}
else if(category == 1 && months >=12 && ans
== 'n' || ans == 'N')
{
cost = 20 - 20 * 0.15;
}
else if(category == 1 && months >=12 && ans == 'y' || ans == 'Y')
{
cout<<"Enter the number of personal training to avail: ";
cin>>p_sessions;
if(p_sessions <= 5)
{
cost = 20 - 20 * 0.15 + (25 * p_sessions);
}
if(p_sessions > 5)
{
cost = 20 - 20 * 0.15 + ( 25 * p_sessions - (p_sessions * 0.20 * 25));
}
}
else if (category == 2 && months < 12 && ans
== 'n' || ans == 'N')
{
cost = 20 - 20 * 0.30;
}
else if(category == 2 && months >=12 && ans
== 'n' || ans == 'N')
{
cost = 20 - 20 * 0.30 - 20 * 0.15;
}
else if(category == 2 && months >=12 && ans == 'y' || ans == 'Y')
{
cout<<"Enter the number of personal training to avail: ";
cin>>p_sessions;
if(p_sessions <= 5)
{
cost = 20 - 20 * 0.30 - 20 * 0.15 + (25 * p_sessions);
}
if(p_sessions > 5)
{
cost = 20 - 20 * 0.30 - 20 * 0.15 + ( 25 * p_sessions - (p_sessions * 0.20 * 25));
}
}
return cost;
}
//start of main function
int main()
{
//setting the precision to two decimal points
cout<<fixed<<setprecision(2)<<endl;
int category, months, cost;
char ans;
//call to functions
display_info();
get_details(category, months, ans);
cost = get_membership_cost(category, months, ans);
//displa the membership cost
cout<<"Your membership fee is: $"<<cost<<endl;
return 0;
}//end of the main function

Kindly revert for any queries
Thanks.
C++ Homework, The cost to become a member of a fitness center is as follows: the...
Please !create a java program for the follwing question.
19. The cost to become a member of a fitness center is as follows: (a) the Senior citizens discount is 30%; (b) if the membership is bought and paid for 12 or more months in advance, the discount is 15%; or (c) if more than 5 personal training sessions are purchased, the discount on each session is 20%. Write a menu driven program that determines the cost of a new membership...
- The senior citizens discount is 30% e 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...
Write a java program. The cost to join a gym is: 1) Senior citizens: get a 30% discount. 2.) If twelve or more months in advance are bought and paid for, a 15% discount is applied to the membership. The user enters the number of months. 3) Personal Training sessions: 20% discount on each session if more than 12 are bought. This will be a menu-driven, GUI program that determines the cost of a new membership.Using JTextField for input and...
C++ exercises During the tax season, every Friday, the J&J accounting firm provides assistance to people who prepare their own tax returns. Their charges are as follows: If a person has low income (<= 25,000) and the consulting time is less than or equal to 30 minutes, there are no charges; otherwise, the service charges are 40% of the regular hourly rate for the time over 30 minutes. For others, if the consulting time is less than or equal to...
C++ Question
Question 3 [43] The Question: You are required to write a program for an Online Tutoring Centre to determine the weekly rate depending on the number of sessions the students attend and then to calculate total revenue for the center. The Online Tutoring Centre charges varying weekly rates depending on the on grade of the student and number of sessions per week the student attends as shown in Table 1 below. Grade 8 9 Session 1 75 80...
Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning an international expansion by opening a new ‘supercenter’ in the Toronto area. Personal Trainer’s president, Cassia Umi, hired an IT consultant, Susan Park, to help develop an information system for the new facility. During the project, Susan will work closely with Gray Lewis, who will manage the new operation. Background During requirements modeling for the new system,...
Week # Assignment Student Name: George Bell, a fitness enthusiast, buys an existing exercise center, Body Firm. Complete the following exercises to begin setting up the accounting function for the company Part 1: Classify each of the following accounts by creating the Chart of Accounts for Body Firm. Fill in the table below with the account numbers. Some categories will have more accounts than others. Cash 111 Capital 134 Land 311 G. Bell, 511 Wages Services 136 Building 411 Income...
Sit-up Fitness (SFC) is a new athletic facility, located in Saskatoon, Saskatchewan. SFC is owned and operated by Calvin Power, a former Olympic gold medallist in weightlifting. Calvin decided to make his pas sion his business by opening open a local gym. SFC has the following mission statement: “SFC provides the residents of Saskatoon the opportunity to live a healthier, happier, and longer life by providing affordable access to athletic equipment, aerobic classes, and specialized dieticians.” Calvin borrowed $10 million...
This is a C++ program Instructions Design a class named PersonData with the following member variables declared as strings: lastName firstName address city state zip phone Create 3 constructors; a default constructor, a constructor that accepts the first and last name member variables, and a constructor that accepts all member variables. Write the appropriate accessor/getter and mutator/setter functions for these member variables. Create a method within this class called getFullName() that returns the person's first and last names as a...
Use C++, Modify the content so that it produces the required output. /* Program uses the cost of a meal to determine the total amount paid given 6% sales tax and a 20% tip */ // DEFINE THE FOLLOWING FUNCTIONS. Use the information provided for each function to determine // the function header and the function body. // return type: float // Parameters: none // Purpose: This function prompts the user for the cost of a meal, validates it and...