Answered step by step
Verified Expert Solution
Link Copied!

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: image text in transcribed

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 program

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions

Question

Does it exceed two pages in length?

Answered: 1 week ago

Question

Does it avoid typos and grammatical errors?

Answered: 1 week ago