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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, tristina20
The isometric projection camera technique provides an illusion of perspective by using things like parallax scrolling to create the illusion of 3d in a 2d game
Answers: 3
image
Computers and Technology, 22.06.2019 20:00, jayjay5246
What is the term for water wave that is created by an underwater earthquake
Answers: 1
image
Computers and Technology, 23.06.2019 18:00, teamroper35
Which finger presses the h key on the keyboard? index finger on the left hand pinky finger on the right hand index finger on the right hand thumb on the left hand
Answers: 1
image
Computers and Technology, 24.06.2019 06:30, hannahgracew12
Some peer-to-peer networks have a server and some don't. true false
Answers: 2
You know the right answer?
2. design a class named sandwich with data fields for description and price. include a constructor t...

Questions in other subjects:

Konu
Mathematics, 04.06.2020 01:57
Konu
Mathematics, 04.06.2020 01:57