Question: programing using java Background: This assignment was adopted from Paul McNamee of Johns Hopkins University to demonstrate the use of inheritance and polymorphism. You will
programing using java
Background: This assignment was adopted from Paul McNamee of Johns Hopkins University to demonstrate the use of inheritance and polymorphism. You will write classes and a main program to simulate different pricing plans for an internet service provider that is expanding its customer base into the remote region of Barrow, Alaska. Due to the remote nature of the area and the difficulty with upgrading the existing infrastructure of communications equipment, you are only able to provide dialup internet. You want to determine which payment plan is better for different customers. The types of plans include the Customer, PowerUser, and Consumer plans.
| customer | power user | consumer | |
| initial time | 4 | 10 | unlimited |
| initial cost | 10 | 20 | 50 |
| additional rate | 4 | 2.5 | none |
| disk space limit | 1 | 50 | unlimited |
| charge per connection | none | none | .10 |
In the Customer plan, customers get 4 hours of connection time a month for $10.00 and pay a fixed rate of $4.00 an hour for access time over 4 hours. The PowerUser plan is designed so that customers who spend more time online save money by paying a higher monthly fee of $20.00 for the first ten hours, and $2.50 an hour after that. Consumer plan members pay $50.00 for unlimited monthly access and also pay an additional charge of 10 cents for each time they dial up.
Your assignment is as follows: Write class definitions for Customer and for the derived subclasses PowerUser, and Consumer. Customer should contain data members common to all customers, like the number of hours connected for a month, the customers name, the amount of disk space the customer requires and so on. Also implement a method for computing a bill, computeBill( ) which uses the appropriate algorithm and data members to compute a monthly charge for each type of customer. In all classes be sure to also include any constructors and other methods that you think are needed, but be sure to adhere to the principle of Designing Sound Classes from Lecture 6. The derived classes should contain any data members and initializations specific to its payment plan, and a specific implementation for the computeBill() method which overrides the default method from the Customer class. Demonstrate programmatically which plan is better for the following customers:
John Dough, a customer spending 6 hours online per month who dialsup 35 times and does not host any web pages (uses zero megabytes of disk space).
Jane Doe, a customer who spends 18 hours online per month, who dialsup 75 times and hosts 30 megabytes of web pages and images. (Note: Customer is not a valid option because of the 1 MB Disk space limit).
Javiar Dinero, a customer who spends 48 hours online per month, who dialsup 90 times, and who hosts 10 megabytes of web pages. (Note: Customer is not a valid option because of the 1 MB Disk space limit).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
