Question

A Cable Company has hired you to write a C++ program that calculates the monthly bill...

A Cable Company has hired you to write a C++ program that calculates the monthly bill for their customers. It must meet the following specifications:

1. The program must first greet the customer.
2. The program must then ask for their name, the number of basic channels packages they’re subscribed to, then the number of premium channel packages they’re subscribed to.
3. The bill is calculated as follows:
1. There is a \$75 base fee.
2. The first 3 basic channels packages are free, after that it costs \$12 for each additional package.
3. Each premium channel package costs \$15.
4. There final total is subject to a 2.35% tax.
4. The program terminates with addressing the user by their name and then telling them how much they owe for the month.

Homework Answers

Answer #1

CODE :

#include <iostream>
using namespace std;

int main()
{
string name;
int bc,pc;
cout<<"Hello there!"<<endl;
cout<<"Please enter your name : "<<endl;
cin>>name;
cout<<"Enter the number of basic channel packages : "<<endl;
cin>>bc;
cout<<"Enter the number of premium channel packages : "<<endl;
cin>>pc;

float cost = 75;
if(bc>3){
cost = cost+(bc-3)*12;
}
cost = cost + pc*15;
cost = cost*1.0235;
cout<<name<<", your bill for the month is : "<<cost;
return 0;
}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question