+1(805) 568 7317

create a class named sandwich data fields include a string for the main ingredient s 5150672

Create a class named Sandwich. Data fields include a String for the main ingredient (such as tuna), a String for bread type (such as wheat), and a double for price (such as 4.99). Include methods to get and set for each of these fields. Add a constructor which sets the price field to 0.00, the ingredient – to “undefined”, and the bread type – to “unknown”.

Create an application class named TestSandwich that instantiates three Sandwich objects and accepts user’s input to specify field values for each Sandwich object (e.g., “Tuna”, “Wheat”, 4.99 ).

Use Scanner class or JOptionPane for data inputs.

"Order a similar paper and get 15% discount on your first order with us
Use the following coupon

Order Now