Question
C++ #include #include using namespace std; void display(); double ask(double& price); int main() { double price; display(); ask(price); cout } void display() { cout return
C++
#include
void display(); double ask(double& price);
int main() { double price; display(); ask(price); cout
}
void display() {
cout
return ;
}
double ask(double& price) {
char senior; char twelveormore; char training;
// asks questions from the user
price = 30.00;
cout > senior; if((senior == 'Y')||(senior == 'y')){ // even if the user hits something other than Y or y it still changes variable cout
cout > twelveormore; if((twelveormore == 'Y')||(twelveormore == 'y')){ cout
cout > training; if((training == 'Y')||(training == 'y')){ cout
return price; }
User-Defined Functions in C++(Example 23) main.cpp i User- Defined Functions The cost to heoomc a member of a fitness center is as ollows Aunt ule oinp using nanespace std * The senior citizens discuurt is 30 6 votd dtsplay) If the membership is bought and paid for 12 or more double ask(doubles price): month, the discount is 1536 If more than five personal training sessions are boughtnt natn) and paid for, the discount on each session 20%. 11 doublc prtcc, 1 display) n program that determines the cost of a Write a menu-driven th new membershlp. Your progrom must contaln a function that displays the peneral informatian about the fitness center and its charges, a lunction to get all of the necessary information to deternine the membership cost, and a function to determine the membership cost. Use approprlate paramcters to pass Information In and out of a function.(Do not use any plahal variables.) 14 cout e "Price will be: prce endl; 15 return 17 19 void display() 20 23 coutnFtness Menu end: c end 25 coutStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started