subject
Computers and Technology, 08.07.2019 16:10 nick607

The abstract class dessert contains data members name and cost. it also defines public methods string which returns the name of the dessert, and public method int implement both of these methods and the standard methods tostring() (return the name and cost of the dessert concatenated in a string) and equals(object) in the following subclasses: • the cake class is derived from the dessert class. a cake object has a number of layers (int). the price of a cake is $15 + $2 per layer. for example, a 3-layer cake costs $21. the number of layers is passed as the parameter to the cake constructor. • the cookiepack class is derived from the dessert class. a cookiepack object has a number (int) indicating how many cookies are in the pack and a price per cookie in dollars (int) which are used to determine its cost. for example, a 5-cookie pack at $2 per cookie = $10. the name/type of the cookies (e. g., chocolate chip cookies) and these two integers are passed in as the parameters to the cookiepack constructor. • the icecream class is derived from the dessert class. an icecream object simply has a cost in dollars (int). the starting value of this cost is passed as the parameter to the icecream constructor. • the sundae class is derived from the icecream class. the cost of a sundae is the cost of the icecream plus the cost of the topping in dollars (int). the starting value of the topping’s cost is passed as a parameter to the sundae constructor.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:00, ajayfurlow
Which option should u select to ignore all tracked changes in a document
Answers: 1
image
Computers and Technology, 22.06.2019 22:30, Metlife
You are new to microsoft certification and want to start out by getting a certification geared around windows 8. what microsoft certification should you pursue?
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, solizpaco7124
1. which of the following is not an example of an objective question? a. multiple choice. b. essay. c. true/false. d. matching 2. why is it important to recognize the key word in the essay question? a. it will provide the answer to the essay. b. it will show you a friend's answer. c. it will provide you time to look for the answer. d. it will guide you on which kind of answer is required.
Answers: 1
image
Computers and Technology, 23.06.2019 23:40, dudedude1593
Which of the following calculates the total from the adjacent cell through the first nonnumeric cell by default, using the sum function in its formula? -average -autosum -counta -max
Answers: 1
You know the right answer?
The abstract class dessert contains data members name and cost. it also defines public methods strin...

Questions in other subjects:

Konu
History, 07.10.2019 22:00
Konu
Mathematics, 07.10.2019 22:00
Konu
Mathematics, 07.10.2019 22:00