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, 23.06.2019 09:00
The first screen you see when you open word2016 what is called?
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
Whats three fourths of 15(this is supposed to be in math but i clicked too fast)
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
What is a dashed line showing where a worksheet will be divided between pages when it prints? a freeze pane a split box a page break a print title
Answers: 1
question
Computers and Technology, 25.06.2019 04:30
What is the purpose of network permissions? a)to control access to network resources b)to convert to wireless networking c)to enable the installation of nics d)to reduce operating costs
Answers: 1
You know the right answer?
(a) define an abstract class, called utilitycustomer, that has one integer instance variable, an acc...
Questions
Questions on the website: 13722363