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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:40
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it
Answers: 2
question
Computers and Technology, 23.06.2019 11:00
How should you specify box sizes on a web page if you want the boxes to vary according to the font size of the text they contain? a. in pixels b. in inches c. as percentages d. in em units
Answers: 2
question
Computers and Technology, 23.06.2019 13:00
Which one of the following voltages should never be measured directly with a vom? a. 1200 v b. 500 v c. 800 v d. 100v
Answers: 2
question
Computers and Technology, 24.06.2019 16:00
Your is an example of personal information that you should keep private.
Answers: 1
You know the right answer?
The abstract class dessert contains data members name and cost. it also defines public methods strin...
Questions
question
Social Studies, 03.10.2019 04:00
Questions on the website: 13722360