Вы находитесь на странице: 1из 5

#include "stdafx.

h"
#include <iostream>
#include <string>
#include <cstdlib>
#include <iomanip>
using namespace std;
using std::setprecision;

int main()
{
double amount;
int type;
double points;
string name;

cout <<"Welcome to Shoppers Haven! \n"<< endl;


cout <<"Please enter your name:\n" << endl;
getline(cin, name);
cout << "\n\n";
cout << "Hello, " << name << "!\n";

cout << "\n\n";

cout << "Please enter your membership type: \n" << endl;
cout << "\n";
cout << "*Note: Choose only from numbers 1 to 7." << endl;
cout << "\n\n";

cout << "1-StandardA Type \n" << endl;


cout << "2-StandardB Type \n" << endl;
cout << "3-StandardC Type \n" << endl;
cout << "4-PlusA Type \n" << endl;
cout << "5-PlusB Type \n" << endl;
cout << "6-PremiumA Type \n" << endl;
cout << "7-PremiumB Type \n" << endl;
cin >> type;
cout << "\n\n";

cout<<"*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*"<<endl;

cout << "\n\n";

switch(type){

case 1:

cout << "What is your total monthly purchase?" << endl;


cout << "\n\n";
cout << "$";
cin >> amount;
cout << "\n\n";
points = amount*0.05;
cout << "Your points is: " << setprecision( 2 )
<< fixed << points << endl;
break;

case 2:

cout << "What is your total monthly purchase?" << endl;


cout << "\n\n";
cout << "$";
cin >> amount;
cout << "\n\n";
points = amount*0.075;
cout << "Your points is: " << setprecision( 2 )
<< fixed << points << endl;
break;

case 3:

cout << "What is your total monthly purchase?" << endl;


cout << "\n\n";
cout << "$";
cin >> amount;
cout << "\n\n";
points = amount*0.1;
cout << "Your points is: " << setprecision( 2 )
<< fixed << points << endl;
break;

case 4:

cout << "What is your total monthly purchase?" << endl;


cout << "\n\n";
cout << "$";
cin >> amount;
cout << "\n\n";
points = amount*0.06;
cout << "Your points is: " << setprecision( 2 )
<< fixed << points << endl;
break;

case 5:

cout << "What is your total monthly purchase?" << endl;


cout << "\n\n";
cout << "$";
cin >> amount;
cout << "\n\n";
points = amount*0.13;
cout << "Your points is: " << setprecision( 2 )
<< fixed << points << endl;
break;

case 6:

cout << "What is your total monthly purchase?" << endl;


cout << "\n\n";
cout << "$";
cin >> amount;
cout << "\n\n";
points = amount*0.04;
cout << "Your points is: " << setprecision( 2 )
<< fixed << points << endl;
break;

case 7:

cout << "What is your total monthly purchase?" << endl;


cout << "\n\n";
cout << "$";
cin >> amount;
cout << "\n\n";
points = amount*0.15;
cout << "Your points is: " << setprecision( 2 )
<< fixed << points << endl;
break;

cout << "\n\n";

cout << "Thank You! Have a good day Ma'am/Sir!" << endl;
cout << "\n\n";

cout<<"*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*"<<endl;

cout << "\n\n";

cout << "For more information please go to our page @ \n" << endl;
cout << "www.shopperhaven.ph" << endl;

system("pause>0");

Вам также может понравиться