Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

An Internet Service Provider has three different subscription packages for its c

ID: 3651382 • Letter: A

Question

An Internet Service Provider has three different subscription packages for its customers: Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour. Package B: For $14.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour. Package C: For $19.95 per month unlimited access is provided Design a class that calculated a customer's monthly bill. It should store the letter of the package the customer has purchased (A,B, or C) and the number of hours that were used. It should have a method that return the total charges. Demonstrate the class in a program that asks the user to select a package and enter the number of hours used. The program should display the total charges. (Use Switch to determine Package)

Explanation / Answer

class ISP { char type; float cost, hours; public float getCharge() { switch (type) { case 'a': cost = 9.95; if(hours > 10) cost + = (hours-10)*2; break; case 'b': cost = 14.95; if(hours > 20) cost + = (hours-20)*1; break; case 'c': cost = 19.95; break; } return cost; } };

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote