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 02:00
6. the is particularly susceptible to the effects of alcohol because it receives a large portion of total blood flow and has a high concentration of neurons. a. heart b. pancreas c. brain d. liver
Answers: 2
question
Computers and Technology, 22.06.2019 10:40
Nims is applicable to all stakeholders with incident related responsibilities. true or false
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
In a compound condition, both conditions on either side of the logical operator and must be true for the overall condition to be true. a: true b: false
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Type the correct answer in the box. spell all words correctly. the managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an
Answers: 1
You know the right answer?
(a) define an abstract class, called utilitycustomer, that has one integer instance variable, an acc...
Questions
question
Biology, 29.07.2021 05:00
question
Mathematics, 29.07.2021 05:00
question
Mathematics, 29.07.2021 05:00
question
Mathematics, 29.07.2021 05:10
Questions on the website: 13722363