#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
using namespace std;
int main () {
int numberOfPackages;
int totalPhoneUsage;
int includedMinutes;
//change const to capital
// Fees, Minutes Provided, rate for additonal ,minutes
const float monthlyFeeA = 39.99;
const int minProvidedA = 450;
const float rateForAddMinA = 0.45;
const float monthlyFeeB = 59.99;
const int minProvidedB = 900;
const float rateForAddMinB = 0.40;
const float monthlyFeeC = 69.99;
float totalSubPrice;
cout<< "Select a subcription package: \n"
<<"1. Package A\n"
<<"2. Package B\n"
<<"3. Package C\n"
<<"4. Quit\n";
// User inputs which packaged theyed like
cin >> numberOfPackages;
switch (numberOfPackages){
case 1:{
cout << "You selected Package A\n";
break;
}
case 2:{
cout << "You selected Package B\n";
break;
}
case 3:{
cout << "You selected Package C\n";
break;
}
case 4: {
cout << "You selected Quit\n";
break;
return 0;
}
default: {
cout << "The valid choices are 1 through 4. Run program again and select one of those.\n";
break;
return 0;
}
}
//Asking user for input on total phone usage in minutes
cout << "How many minutes were used?: ";
cin >> totalPhoneUsage;
// if else branches to determine additional rate, included min and monthly fee
// add set precision finish code, delete unneeded variables.
if (numberOfPackages == 1){
if (totalPhoneUsage <= minProvidedA){
cout << "The total amount due is $ "<< monthlyFeeA;
}
else if (totalPhoneUsage > minProvidedA) {
float totalOver = (totalPhoneUsage - minProvidedA) * rateForAddMinA;
float totalDue = monthlyFeeA + totalOver;
cout << "The total amount due is:$ " << totalDue << endl;
}
}
else if (numberOfPackages == 2){
if (totalPhoneUsage <= minProvidedB) {
cout << "The total amount due is $ "<< monthlyFeeB; }
else if (totalPhoneUsage > minProvidedB){
float totalOver = (totalPhoneUsage - minProvidedB) * rateForAddMinB;
float totalDue = monthlyFeeB + totalOver;
cout << "The total amount due is:$ " << totalDue << endl;
}
}
else if (numberOfPackages == 3) {
cout << "The total amount due is $ " << monthlyFeeC << endl;
}
return 0;
}