Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // main.cpp
- // gym.cpp
- //
- #include <iostream>
- using namespace std;
- int main()
- {
- string customername;
- string membershiptype;
- double trainingsessionscost = 10.00;
- double trainingsessions;
- double trainingsessionstotal = 0.0;
- double total = 0.0;
- double initiationfee = 19.99;
- cout.setf(ios::fixed);
- cout.precision(2);
- cout << "Customer Name: ";
- getline( cin, customername );
- if (customername.length() == 0 )
- {
- cout << "---You must enter a customer name";
- } else
- cout << "Training Sessions per month: ";
- cin >> trainingsessions;
- if (trainingsessions < 0 ) {cout << "---The sessions used must not be negative ";}
- cout << "Membership type: ";
- cin >> membershiptype;
- if (membershiptype != "Executive" && membershiptype != "Regular") {
- cout << "---The membership type is not valid ";
- }
- {
- if (membershiptype == "Executive")
- {total += 55.00;}
- }
- if (membershiptype == "Regular")
- {total += 30.00;}
- if (trainingsessions == 0 && membershiptype == "Regular")
- {total += 19.99;}
- trainingsessionstotal = trainingsessionscost * trainingsessions;
- total += trainingsessionstotal;
- cout << "---The membership fee for " << customername << " is " << "$" <<total << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement