subject

(a) define an abstract class, called utilitycustomer, that has one integer instance variable, an account number, and an abstract method, called calculatebill, that returns the bill amount as double. the utility customer class implements the comparable interface, and includes a constructor that is passed a parameter for initializing the instance variable. it includes also accessor and mutator methods for the instance variable, and a tostring method that returns a string for displaying the account number. the utilitycustomer class has two non-abstract subclasses that inherit from the utility customer: gascustomer and electriccustomer. (b) gas customer class has two additional fields, the cubicmeters used instance variable, and a constant for the price of gas per cubic meter of $2.75. include appropriate constructor for initializing the class instance variable, accessor and mutator methods for class's instance variable, and implement the calculatebill method. write a tostring method, that calls the tostring method of the utilitycustomer a formatted string to display the gas customer's account number, the gas consumption, and the amount charged. (c) electric customer class has three additional fields, kwatthourused instance variable, along with two constants, one for the price of electricity per kilowatt hour, and the other for a flat power delivery fee of $30 that is added to every bill. include appropriate constructor for initializing the class instance variable, and accessor and mutator methods for class's instance variable. write a tostring method, that calls the tostring method of the utilitycustomer, and implements the calculate bill method. (d) write a client class, called collection ofucustomers, that maintains a list of utilitycustomer objects created by a user. the client class prompts a user for the type of a utilitycustomer and its corresponding parameters to create. the program allows the user to specify up to 10 utility customer objects to be stored in an array. the program should display the information of utilitycustomer objects in descending order based on their account numbers.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:30
What type of computer network ensures high security ?
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
The basic work area of the computer is it screen that you when you first fire up your computer
Answers: 1
question
Computers and Technology, 24.06.2019 23:30
Adrian has decided to subscribe for a new internet connection. he wants a high speed connection so that he can stream video content smoothly. which access technology would you advise adrian against using?
Answers: 1
question
Computers and Technology, 25.06.2019 03:00
1. how do you view the edited document without the track changes markup? a. select accept all changes in document in the accept drop-down menu.b. click on restrict editing in the protect group.c. click on the reviewing pane drop-down menu in the tracking group.d. click on final in the display for review drop-down menu.
Answers: 3
You know the right answer?
(a) define an abstract class, called utilitycustomer, that has one integer instance variable, an acc...
Questions
question
Mathematics, 19.08.2019 01:50
question
Mathematics, 19.08.2019 01:50
Questions on the website: 13722367