Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a. Create a class for a Sandwich Shop (Tip Top Bakery) with data fields for bread type (such as Wheat) and calories per slice. Include

a. Create a class for a Sandwich Shop (Tip Top Bakery) with data fields for bread type (such as Wheat) and calories per slice. Include a constructor that takes parameters for each field, and include get methods that return the values of the fields. Also include a public final static String named MOTTO and initialize it to The Way A Sandwich Was Meant To Be. Write an application named TestBread to instantiate three Bread objects with different values, and then display all the data, including the Slogan, for each object. Save both the Bread.java and TestBread.java files.

b. Create a class named Sandwich Filling. Include a field for the filling type (such as tuna salad) and another for the calories in a serving. Include a constructor that takes parameters for each field, and include get methods that return the values of the fields. Write an application named TestSandwichFilling to instantiate three SandwichFilling objects with different values, and then display all the data for each object. Save both the SandwichFilling.java and TestSandwichFilling.java files.

c. Create a class named Sandwich. Include a Bread field and a Sandwich Filling field. Include a constructor that takes parameters for each field needed in the two objects and assigns them to each objects constructor. Write an application named TestSandwich to instantiate three Sandwich objects with different values, and then display all the data for each object, including the total calories in a Sandwich, assuming each Sandwich is made using two slices of Bread. Save both the Sandwich.java and TestSandwich.

d. Create a class named Order that contains customer name, bread type and filling. The Sandwich shop carries 4 types of bread and 4 types of filling (you decide types of bread or filling the shop carries). Create a class named TestOrder that allows the customer to order as many sandwiches as wanted and prints out the customer name and then all the sandwiches (bread type, filling and total calories) ordered.

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

Oracle PL/SQL Programming Database Management Systems

Authors: Steven Feuerstein

1st Edition

978-1565921429

More Books

Students also viewed these Databases questions

Question

How could assessment be used in an employee development program?

Answered: 1 week ago