Answered step by step
Verified Expert Solution
Question
1 Approved Answer
- -- Typy ul. Create a class named Sandwich Data fields include a String for the main ingredient (such as tuna), a String for bread
- -- Typy ul. 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-lo "undefined", and the bread type-to unknown Create an application class named Test Sandwich 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 Submit two java files (Sandwich.java and Test Sandwich.java) and one MS Word .doc file with the screen shots of the running application and detailed explanation of your solution Do not forget to include the proper comments for each of the statements in both Java classes and the application header in the TestSandwich java file Zip all three files (twojava file and MS Word file) as one zip archive
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started