In: Computer Science
Using C++
There are number of cable company in southern California which offer number of services
for customers. This company have two types of customers:
Residential and business. There are two rates for calculating a cable bill: one for Residential customers and one for business customers.
For residential customers the following rates apply:
For business customers the following rates apply:
Input:
The customer’s account number,
Customer code
Number of premium channels
And in case of business customers, number of basic service connections
What to deliver (output) Customers’ account number and the billing amount
Run your program for the given data:
Enter customer code: R or r (Residential) or B or b (Business) B
Enter number of service connections 16
Enter number of premium channels 8
Display total billing amount:
Run for residential customers:
R
Test your program for 12 premium channels.
flow chart, pseudo code are required for every projects and activities.
If you have any doubts, please give me comment...
#include<iostream>
#include<string>
using namespace std;
int main(){
int account_number;
int no_channels;
string customer_code;
char cust_type;
cout<<"Enter Customer account number: ";
cin>>account_number;
cout<<"Enter Customer Code: ";
cin>>customer_code;
cout<<"Enter customer code: R or r (Residential) or B or b (Business): ";
cin>>cust_type;
double bill = 0;
if(cust_type=='r' || cust_type=='R'){
cout<<"Enter number of premium channels: ";
cin>>no_channels;
bill = 4.50;
bill += 20.50;
bill += no_channels*7.50;
}
else{
int no_connections;
cout<<"Enter number of service connections: ";
cin>>no_connections;
cout<<"Enter number of premium channels: ";
cin>>no_channels;
bill = 15.00;
if(no_connections<=10)
bill += 75.00;
else
bill += 75.00 + ((no_connections-10)*5.00);
bill += no_channels*50.00;
}
cout<<"The bill is: $"<<bill<<endl;
return 0;
}