1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Olin [163]
4 years ago
7

The cost to become a member of a fitness center is as follows: the membership fee per month is $50.00 the personal training sess

ion fee per session is $30.00 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 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. Your program must also be a menu driven program. Given the user 2 options as follows: Calculate membership costs. quit this program.
Engineering
1 answer:
NikAS [45]4 years ago
8 0

Answer:

#include <iostream>

using namespace std;

void information(){

cout<<"Welcome to the portal"<<endl;

cout<<"The membership fee per month is $50.00"<<endl;

cout<<"The personal training session fee is $30.00"<<endl;

cout<<"The senior citizens discount is 30%"<<endl;

cout<<"If the membership is bought and paid for 12 or more months, 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;

}

void getInfo(bool &senior, int &months, int &personal){

cout<<"Are you senior citizen y/n ? : ";

char choice;

cin>>choice;

if(choice=='y' || choice=='Y'){

senior = true;

}else{

senior = false;

}

cout<<"Enter number of months for membership : ";

cin>>months;

cout<<"Enter number of personal training session : ";

cin>>personal;

}

double calcCost(bool senior, int months, int personal){

double cost=0;

double memberShipCost=months*50;

double trainingCost=personal*30;

if(personal>5){

trainingCost*=.80; //discount on personal training

}

if(months>=12){

memberShipCost*=.85; //discount on membership

}

cost = memberShipCost+trainingCost;

//discount for seniors

if(senior){

cost = cost*.70;

}

return cost;

}

int main() {

information();

cout<<"Select an option"<<endl;

char choice;

while(true){

cout<<endl<<endl;

cout<<"a. Calculate membership costs."<<endl;

cout<<"b. Quit program."<<endl;

cout<<"Enter your choice : ";

cin>>choice;

bool senior=true;

int months,personal;

if(choice=='a'){

getInfo(senior,months,personal);

double cost=calcCost(senior, months, personal);

cout<<"The calculated cost is $"<<cost<<endl;

}else if(choice=='b'){

break;

}

}

return 0;

}

Explanation:

You might be interested in
The “Sun-Star” Company has purchased new office furniture for their offices at a retail price of $100,000. An additional $12,000 h
Zinaida [17]

Based on the cost of the furniture, the following are true:

  • a. $10,400.
  • b. $93,600
  • c. $20,800

<h3>Depreciation in second year</h3>

Depreciation per year = (Cost of furniture - Salvage value) / Useful life

Cost will include both the purchase price and the charge for insurance and shipping.

= (100,000 + 12,000 - 8,000) / 10

= $10,400

<h3>BV at end of first year</h3>

= Cost - Depreciation

= 104,000 - 10,400

= $93,600

<h3>BV after 8 years </h3>

= Cost - (Depreciation x 8 years )

= 104,000 - (10,400 x 8)

= $20,800

In conclusion, depreciation is $10,400 per year.

Find out more about SL depreciation at brainly.com/question/13734742.

4 0
3 years ago
Someone claims that in fully developed turbulent flow in a tube, the shear stress is a maximum at the tube surface. Is this clai
Alika [10]

Answer:

Yes this claim is correct.

Explanation:

The shear stress at any point is proportional to the velocity gradient at any that point. Since the fluid that is in contact with the pipe wall shall have zero velocity due to no flow boundary condition and if we move small distance away from the wall the velocity will have a non zero value thus a maximum gradient will exist at the surface of the pipe hence correspondingly the shear stresses will also be maximum.

5 0
4 years ago
The speed of sound is 1150 ft/s convert to mile/h
Sonbull [250]

Answer:

784.090909mph

Explanation:

1ft/s=0.681818 mph

1150ft/s=0.681818 x 1150=784.090909

6 0
3 years ago
A wastewater is to be disinfected using ultraviolet (UV) light. Batch experiments find that the bacterial concentration decays u
Ksivusya [100]

Answer:

k = 0.1118 per min

Explanation:

Assume;

Initial number of bacteria = N0

Number of bacteria IN 'T' time = Nt

So,

Nt=N0e^{-kt}\\\\in\ 6.2 min\\\\\\frac{N0}{2}= N0e^{-k(6.2)}\\\\ln\frac{1}{2} = -k[6.2]

k = 0.1118 per min

7 0
3 years ago
A hollow steel tube with an inside diameter of 100 mm must carry a tensile load of 400 kN. Determine the outside diameter of the
Olegator [25]

Answer:

119.35 mm

Explanation:

Given:

Inside diameter, d = 100 mm

Tensile load, P = 400 kN

Stress = 120 MPa

let the outside diameter be 'D'

Now,

Stress is given as:

stress = Load × Area

also,

Area of hollow pipe = \frac{\pi}{4}(D^2-d^2)

or

Area of hollow pipe = \frac{\pi}{4}(D^2-100^2)

thus,

400 × 10³ N = 120 × \frac{\pi}{4}(D^2-100^2)

or

D² = tex]\frac{400\times10^3+30\pi\times10^4}{30\pi}[/tex]

or

D = 119.35 mm

7 0
3 years ago
Read 2 more answers
Other questions:
  • A driver traveling at 65 mi/h rounds a curve on a level grade to see a truck overturned across the roadway at a distance of 350
    13·1 answer
  • An 800-kg drag racer accelerates from rest to 390 km/hr in 5.8 s. What is the net impulse applied to the racer in the first 5.8
    10·1 answer
  • A car engine operates with a thermal efficiency of 20%. Assume the air-conditioner has a coefficient of performance of β = 2 wor
    5·1 answer
  • A team of engineers in designing a new rover to explore the surface of Mars.
    8·2 answers
  • Heating of Oil by Air. A flow of 2200 lbm/h of hydrocarbon oil at 100°F enters a heat exchanger, where it is heated to 150°F by
    7·1 answer
  • Mr. Ray deposited $200,000 in the Old and Third National Bank. If the bank pays 8% interest, how much will he have in the accoun
    10·2 answers
  • What does the supply chain management process involve
    6·1 answer
  • Every time I take a photo, that photo has to be stored in a file somewhere within "My Files" correct?
    15·2 answers
  • A steel wire is suspended vertically from its upper end. The wire is 400 ft long and has a diameter of 3/16 in. The unit weight
    13·1 answer
  • Okay<br>going offline bye<br>have a great day​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!