Answered step by step
Verified Expert Solution
Question
1 Approved Answer
question 1(b) and please add comment in code QUESTION 1 A broadband company, Malaysia SuperBand charges its customers according to the type of package chosen:
question 1(b) and please add comment in code
QUESTION 1 A broadband company, Malaysia SuperBand charges its customers according to the type of package chosen: 88 Package Type Internet Quota Price Exceed Quota Usage Charge Basic (8) 6GB 48 RMO. 10 every 1MB Advanced (A) 10GB RM0.05 every 1MB a) Write the following function: double calcharge (char, Int). This function will calculate the charge for internet use. It receives the package type and the amount of data used (in megabyte) as parameters and then calculates and returns the charge. Example calculation Package: B Internet use: 6800 MB (6.8 GB) - exceeds quota Charge=Basic charge + Extra charge = 48 + (6800 - 6000) * 0.20 = 48 + 80 Charge= RM 128 Package B Internet use: 5500 MB (5.5 GB) - does not exceed quota Charge=Basic charge = RM 48 (5 marks) b) Write a C++ program to calculate the bill for Malaysia SuperBand's customers. It starts by asking for the number of customers. For each customer it will then ask for their name, their package type and the amount of data used. It then displays the amount to be paid by the customer. The program will call the function in (a) to perform related tasks At the end, the program will display the total amount to be collected from all customers, the number of customers for each package type and the name of the customer who has to pay the highest amount. Sample output screen: ******* Welcome to Malaysia Super Band ******** Please enter the number of customers: 20 Customer 1 Enter Name: Abdul Rahman Enter Package type (A - advance, B - Basic): B Enter Total Internet use in MB): 6800 Total to be paid by Abdul Rahman: RM 128 Customer 2: Enter Name: Siti Hayati Enter Package type (A - advance, B- Basic): A Enter Total Internet use (in MB) : 9000 Total to be paid by Siti Hayati: RM 88 Customer 3: Enter Name: Muhammad Ali Enter Package type (A - advance, - Basic): A Enter Total Internet use (in MB): 10000 Total to be paid by Muhammad Ali: RM 138 Total Charges : RM-.. Number of customers for package A: .. Number of customers for package B:.. The customer with the highest charge is (12 marks) (17 MARKS)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started