Part B Create an application named TestSandwich that prompts the user for data, instantiates one Sandwich object, and displays its values. An example of the program is shown below: Enter main sandwich ingredient >> tuna Enter bread type >> wheat Enter sandwich price >> 8.50 You have ordered a tuna sandwich on wheat bread, and the price is 8.5

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Part B

Create an application named TestSandwich that prompts the user for data, instantiates one Sandwich object, and displays its values.

An example of the program is shown below:

Enter main sandwich ingredient >> tuna

Enter bread type >> wheat

Enter sandwich price >> 8.50

You have ordered a tuna sandwich on wheat bread, and the price is 8.5

Q
O
STUDENT CODERNES LITENUTE SUPPLE
Triebehee
PROJECTS
Companion - st X *MindTap - Ceng X Q testsandwich ja X Q testsandwich ja X C Solved: Chapter X
Ő https://literate-sniffle-x5wx9wg5x7w4fr5r.github.dev/?folder=/workspaces/9780357673423_java-programming...
Į. Prvilambwick jean
31
16
16
12
20
"1
11
13 //createject for the sandwich class
18
29
22
24
21
26
26
22
29
// write your ca
public class testach
{
as
42
//Create a main function of the program
public static void main(string)
{
Sanich
// call using at the instanties
and destrate Sandwich object
c.);
Spton.out.println("and details:");
// calling get the instantiate
and strate Sandwich
Sports("Ingratant:"+b]-gortadningrozient()
}
"out");
Soutrintiswi d
F
PELA GUTALT SPECTRAL FOR
ng-a-kardas-ok-t20-c-roundhapter ACARN
wa: thit
w
ang: th
w: www
mait
Twaal
1-1200-SALD-FLAUNCH ONT
ChapBanquamq, issuciart: (saspikese) $ 30-up "room actre joa-programming-on-one-on-one-cunnydaptatta warak
E-ZENKO-SALE-Hİ KUNCHUYECHÝichapsanquik, isuart (sepārse) $
v klamalar walle
Task Focate the sandwich class.
chegg.com/hor X
Q
Al
15
How to Use the Code Editor
1. Select the "Run Code' button to cute the program.
2. Select the "Calculate Grade" button to generate a score based on the completed tasks.
2. Continue to modify run, and calculate your code until you are happy with the grade
4. Select the "Submit" button to turn in the assignment to your instructor
Part A
Create a class named sandwich. Data fields include a string for the main ingredient such as tunal assainingredient, a string for bread type (such as wheat) at bread, and a double for price (such as 4.9) at price.
include methods to get and set values for each of the three datafile
Part B
Create an application named festsandwich that prompts the user for data, instantiates one sandwich object, and displayetvalue.
An example of the program is shown below:
sterin undich ingredient
inter bread type what
3
seter sandwich price >> 8.5
You have ardered a tua candwich as wheat bread, and the price is 8.5
Tasked the the data fields to the sandwich class.
Tak had et and get reathade for the saingan datafield.
Task Add set and get awthods for the bread data feld
Task Focate the Testanddich application
Task Fond set and get rethods for the price datafield.
Your current grade in: 83.33%
RUN CODE
cp2406_farrell8 X
{} ()
+
SUBMIT
000
Bo
*
Transcribed Image Text:Q O STUDENT CODERNES LITENUTE SUPPLE Triebehee PROJECTS Companion - st X *MindTap - Ceng X Q testsandwich ja X Q testsandwich ja X C Solved: Chapter X Ő https://literate-sniffle-x5wx9wg5x7w4fr5r.github.dev/?folder=/workspaces/9780357673423_java-programming... Į. Prvilambwick jean 31 16 16 12 20 "1 11 13 //createject for the sandwich class 18 29 22 24 21 26 26 22 29 // write your ca public class testach { as 42 //Create a main function of the program public static void main(string) { Sanich // call using at the instanties and destrate Sandwich object c.); Spton.out.println("and details:"); // calling get the instantiate and strate Sandwich Sports("Ingratant:"+b]-gortadningrozient() } "out"); Soutrintiswi d F PELA GUTALT SPECTRAL FOR ng-a-kardas-ok-t20-c-roundhapter ACARN wa: thit w ang: th w: www mait Twaal 1-1200-SALD-FLAUNCH ONT ChapBanquamq, issuciart: (saspikese) $ 30-up "room actre joa-programming-on-one-on-one-cunnydaptatta warak E-ZENKO-SALE-Hİ KUNCHUYECHÝichapsanquik, isuart (sepārse) $ v klamalar walle Task Focate the sandwich class. chegg.com/hor X Q Al 15 How to Use the Code Editor 1. Select the "Run Code' button to cute the program. 2. Select the "Calculate Grade" button to generate a score based on the completed tasks. 2. Continue to modify run, and calculate your code until you are happy with the grade 4. Select the "Submit" button to turn in the assignment to your instructor Part A Create a class named sandwich. Data fields include a string for the main ingredient such as tunal assainingredient, a string for bread type (such as wheat) at bread, and a double for price (such as 4.9) at price. include methods to get and set values for each of the three datafile Part B Create an application named festsandwich that prompts the user for data, instantiates one sandwich object, and displayetvalue. An example of the program is shown below: sterin undich ingredient inter bread type what 3 seter sandwich price >> 8.5 You have ardered a tua candwich as wheat bread, and the price is 8.5 Tasked the the data fields to the sandwich class. Tak had et and get reathade for the saingan datafield. Task Add set and get awthods for the bread data feld Task Focate the Testanddich application Task Fond set and get rethods for the price datafield. Your current grade in: 83.33% RUN CODE cp2406_farrell8 X {} () + SUBMIT 000 Bo *
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Dictionary
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education