1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
using namespace std;
int main()
{
char serv, choice;
double accountnumber, min, min2, min3, min4, total, daymin, daymin1, daymin2, daytotal, nightmin, nightmin1, nightmin2, nighttotal;
cout << "What is your Account number?" << endl;
cin >> accountnumber;
cout << "What type of service do you have? Remember, R is regular and P is premium" << endl;
cin >> serv;
if(serv == 'r' || serv == 'R' || serv == 'p' || serv ==' P'){
if (serv == 'r' || serv == 'R'){
cout << "How many minutes did you use?" << endl;
cin >> min;
if (min > 50){
min2 = min - 50;
min3 = min2 * .20;
total = min3 + 10;
cout << accountnumber << "\t" << serv << "\t" << min << "\t" << "$" << total << endl;
};
else{
cout << accountnumber << "\t" << serv << "\t" << "Your Bill is : $10" << endl;
};
};
if (serv == 'p' || serv == 'P'){
cout << "How many day time Minutes did you use? Remember, daytime minutes are those used between 6AM and 6PM" << endl;
cin >> daymin;
cout <<"How many night time Minutes did you use? Remember, night time minutes are those used between 6PM and 6AM" << endl;
cin >> nightmin;
daymin1 = daymin - 75;
daymin2 = daymin1 * .10;
daytotal = daymin2 + 25;
nightmin1 = nightmin - 100;
nightmin2 = nightmin1 * .05;
nighttotal = nightmin2 + 25;
};
};
else
cout << "Invalid input" << endl;
return 0;
}
|