Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please create a JAVA program by following these directions: How to start the first program: (compile only) // your name class Ch4lastnameSandvich I/ define 3
Please create a JAVA program by following these directions:
How to start the first program: (compile only) // your name class Ch4lastnameSandvich I/ define 3 variables private String mainlng private String bread; private double price, // set and get maingredient public void setMainlngredient(String ingredient) // receives ingredient from the second program mainlngredient = ingredient, public String getMainIngredient /// returns mainIngredient to the second program return mainlngredient /I/ set and get bread How to start the second program: (compile and run) II your name import java.unili.Scann public static void main (String args[]) Ch4lastnameSandwich sandwich = new Ch4lastnameSandwich(); // instantiates (creates) one Sandwich object // define 3 variables String ingredient String bread; double price: Scanner input = new Scanner(System.in); System. out. print("Enter main sandwich ingredient >> "); igredient = input.nextLine(); finish the programStep 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