subject

2. design a class named sandwich with data fields for description and price. include a constructor that requires arguments for both fields and a method to display the data (example value for description is chicken). create a subclass named delivery sandwich that inherits from sandwich and has a delivery fee and a delivery address as additional fields. the description, price, and delivery address are required as arguments to the subclass constructor. the delivery fee should be set to $3 if the sandwich ordered costs more than $15; otherwise it should be set to $5. write an application that instantiates at least two objects of each type and displays their state (data).

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:30
Eye injuries usually occur as a result of all of the following things, except: a) proper machine operation b) battery explosion c) falling or flying debris d) electric welding arc
Answers: 2
question
Computers and Technology, 22.06.2019 16:30
What type of file does a cookie place on web site visitors' computers so that web site managers can customize their sites to their visitors' preferences?
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
How is the number 372 written when expanded out to place values in the base 8 (octal) number system? a. 2 x 4 + 3 x 2 + 4 x 1 b. 3 x 64 + 7 x 8 + 2 x 1 c. 3 x 8 + 7 x 7 + 2 x 6 d. 3 x 100 + 7 x 10 + 2 x 1
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
Based on your knowledge of a good network, describe what you think is a perfect network would be. what kind of information and resources could users share on this network. what would the network administrator do? what kind of communication would be used?
Answers: 1
You know the right answer?
2. design a class named sandwich with data fields for description and price. include a constructor t...
Questions
question
Mathematics, 25.04.2020 03:19