Java Reference
In-Depth Information
￿ Premium channels: $7.50 per channel
For business customers, the following rates apply:
￿ Bill-processing fee: $15.00
￿ Basic service fee: $75.00 for the first 10 connections; $5.00 for
each additional connection
￿ Premium channels: $50.00 per channel for any number of connections
The program should ask the user for an account number (an integer) and a customer
code. Assume that R or r stands for a residential customer, and B or b stands for a
business customer.
Input: Input to the program is the customer's account number, customer code,
number of premium channels to which the customer subscribes, and, in the
case of business customers, the number of basic service connections.
Output: Customer's account number and the billing amount.
The purpose of this program is to calculate and print the billing amount. To calculate
the billing amount, you need to know the customer for whom the billing amount is
calculated (whether the customer is residential or business) and the number of
premium channels to which the customer subscribes. In the case of a business
customer, you also need to know the number of basic service connections. Other
data needed to calculate the bill, such as bill-processing fees and the cost of a
premium channel, are known quantities. The program should print the billing
amount to two decimal places, which is standard for monetary amounts. This
problem analysis translates into the following algorithm:
1. Prompt the user for the account number and customer type.
2. Determine the number of premium channels and basic service
connections, compute the bill, and print the bill based on the
customer type:
a.
PROBLEM
ANALYSIS
AND
ALGORITHM
DESIGN
If the customer type is R or r :
i. Prompt the user for the number of premium channels.
ii. Compute the bill.
iii. Print the bill.
b.
If the customer type is B or b :
i. Prompt the user for the number of basic service connec-
tions and number of premium channels.
ii. Compute the bill.
iii. Print the bill.
 
Search WWH ::




Custom Search