// declare variables and constants
int B;
int b;
int cable_box;
int hasHBO;
double cable_box_fee;
double employee_discount;
char cabletastic_employee;
int customer_ID;
int service_level;
double subtotal;
double total;
string yes;
int H;
int h;
//header for use later
void header()
{
cout << left << setw(10);
cout << " CableTastic Bill Calculation Program";
}
// user defined function for cable box fee
void cablebox_fee()
{
if (cable_box < 2){
cout << " Note: Currently you have less than 2 cable boxes." << endl;
cout << left << setw(10);
cout << " You may have up to two cable boxes for free." << endl;
}
else if (cable_box > 4){
cout << " Warning : Using more than 4 cable boxes may degrade your signal";
cout << endl;
}
if (cable_box > 2)
if (B = service_level)
cable_box_fee = cable_box * 7.50;
else if (b = service_level)
cable_box_fee = cable_box * 7.50;
else
cable_box_fee = cable_box * 11.25;
}
int main()
{
//input
//************************************************************
cout << " Enter the customer id: ";
cin >> customer_ID;
//enter "B" for basic or "P" for preferred
cout << endl << " Service level ([B]asic, [P]referred)? ";
cin >> service_level;
cout << endl << endl;
cout << " Enter the number of cable boxes: ";
cin >> cable_box;
cout << endl << endl;
Enter the customer id: 3
Service level ([B]asic, [P]referred)? 2
Enter the number of cable boxes: 3
H = HBO channels
N = No premium chanels
Premium chanels (H/N)? 4
Cabletastic employee? (yes or no, all lowercase): re
CableTastic Bill Calculation Program Customer Id:3
Service:43
Cable Boxes:3
Monthly Rate:43
Cable Box Fee:0
Premium channels:9
--------
Subtotal:52
Employee Discount:0
--------
Total:52
Seems to let me input after service level.
Top tip; = is an assignment of value. == is a logical test for equality.
OK, I too get the program to prompt all the way through as long as I don't use the "b" or "p" for service level or the "h" or "n" for premium channels, but when I use any of those it skips asking for anything after that.