PROBLEM 3 : CABLE COMPANY BILLING
A local cable company wants to calculate a customer’s
bill. There are two types of customers: residential and business. And, there
are also two rates for calculating a cable bill: one for residential customers
and one for business customers. For the residential customers, the following
rates applied:
Bill
processing fee = RM4.50
Basic
service fee = RM20.50
Premium
channels = RM7.50 per channel
For business customers, the following rates applied:
Bill
processing fee = RM15.00
Basic service fee = RM75.00 for first 10 connections,
RM5.00 for each additional
connection
Premium
channels = RM50.00 per channel for
any number of connections
Input
The program should ask the user for an account number (an
integer), a customer code, number of
premium channels to which the user subscribes, and, in the case of business
customers, number of basic service connections. Assume that R or r stands for
residential customer, and B or b stands for a business customer.
Output
Customer’s account number and the billing amount.
Sample input
|
Sample Output
|
12345
b
8
16
|
12345
520.00
|
Problem Setter : Umi Hanim Mazlan