Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I. Suppose you are given a contract to develop a system that generates bills for a cellular phone company. Company has two types of customers

I. Suppose you are given a contract to develop a system that generates bills for a cellular phone company. Company has two types of customers : Regular (R), Business (B).

For business customers:

Monthly base payment is $99.99 and the first 600 minutes are free. Next 100 minutes (stage 1) company charges $0.45 per minute. Other remaining minutes (stage 2) cost $0.99 per minute.

For regular customers:

Monthly base payment is $29.99 and the first 200 minutes are free. Next 250 units (stage 1) cost $0.55 per minute. Other remaining minutes (stage 2) cost $0.88 per minute.

Develop a system that reads customer information including the phone usage (in muntes) from the keyboard and produces the phone bill according to the criteria given above. Please see the sample system input/output given below for a Regular Customer. Similar output will be produced for Business Customers.

Also, create your program so that it is capable of producing as many bills as needed. This can be done by asking the user if he/she has more bills to produce. If yes, return to the bill generator, else exit from the program. Please see the sample output given below.

Input Validation:

a) If user enters any category other than R, r and B, b then the program should display an error message saying, "Invalid customer type. Please enter R, r for Regular or B, b for business customers," and ask the user to re-run the program correctly.

b)Minutes used should be greater than or equal to zero.

II.[5 Bonus Points] - Include the modified program as comment lines in the program. See the skeleton of the Assignment3.cpp given.

Input Validation:

a) If the user enters an invalid customer type, program should allow the user to enter valid customer type up to three times. Similarly, your program should give the user max three chances to enter valid number for the minutes used.

Sample output

Please Enter the Customer Type (R for Regular, B for Business): R [enter]

Please Enter the Customer Phone Number: 480-897-8978 [enter]

Enter the phone usage in minutes: 476 [enter]

Power Bill for 480-897-8978

==============

Total Minutes Used= 476

Monthly base payment: $ 29.99

Cost for Stage1 units: $ 137.50

Cost for Stage2 units: $ 22.88

Total Cost: $ 190.37

More bills? [Y/N]: y

Please Enter the Customer Type (R for Regular, B for Business): R [enter]

Please Enter the Customer Phone Number: 480-897-8978 [enter]

Enter the phone usage in minutes: 346 [enter]

Power Bill for 480-897-8978

==============

Total Minutes Used= 346

Monthly base payment: $ 29.99

Cost for Stage1 units: $ 80.30

Cost for Stage2 units: $ 0.00

Total Cost: $ 110.02

More bills? [Y/N]: N

exiting the program..............

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Distributed Relational Database Architecture Connectivity Guide

Authors: Teresa Hopper

4th Edition

0133983064, 978-0133983067

More Books

Students also viewed these Databases questions