Homework 05

Peanut Butter and Jelly Sandwich
Due 11/15/2024 by 11:55pm

 

 

Objective:

Practice object-oriented principles by making two Peanut Butter and Jelly Sandwiches. The program must create two sandwiches based on user input. The sandwich information for both must then print out their details and determine if the two sandwiches are equal.

 

Requirements: 

 

 

 

Example Dialog:

*The following Example Dialog demonstrates the interactions between a user and ONE possible implementation of the required software’s front-end / user interface. The software’s front-end / user interface may be implemented in MANY different ways and will receive full credit as long as it meets the most minimal of the above requirements. While you may use the example dialog as a guide, it is strongly encouraged to create the front-end / user interface in your own way. *

Key

Unhighlighted Text

Program’s Output

Highlighted Text

User’s Input

 

-----------------------------------

Welcome to the PBJ Sandwich Maker!

-----------------------------------

-----Sandwich 1-----

Top Slice of Bread Information

Enter name of the bread

Wonder Bread

Enter the number of calories

80

Enter the type of bread. Must be "Honey Wheat", "White", "Whole Grain", or "Whole Wheat"

whole wheat

Peanut Butter Information

Enter name of the peanut butter

JIF

Enter the number of calories

190

Is it crunchy? Enter "true", or "false"

false

Jelly Information

Enter name of the jelly

Smuckers

Enter the number of calories

150

Enter the type of bread. Must be "Apple", "Blueberry", "Grape", "Strawberry", or "Tomato"

Apple

Bottom Slice of Bread Information

Enter name of the bread

Wonder Bread

Enter the number of calories

120

Enter the type of bread. Must be "Honey Wheat", "White", "Whole Grain", or "Whole Wheat"

honey Wheat

 

-----Sandwich 2-----

Top Slice of Bread Information

Enter name of the bread

Pepperidge Farm

Enter the number of calories

100

Enter the type of bread. Must be "Honey Wheat", "White", "Whole Grain", or "Whole Wheat"

Whole grain

Peanut Butter Information

Enter name of the peanut butter

Peter Pan

Enter the number of calories

180

Is it crunchy? Enter "true", or "false"

true

Jelly Information

Enter name of the jelly

Welch's

Enter the number of calories

150

Enter the type of bread. Must be "Apple", "Blueberry", "Grape", "Strawberry", or "Tomato"

Grape

Bottom Slice of Bread Information

Enter name of the bread

Lender's

Enter the number of calories

150

Enter the type of bread. Must be "Honey Wheat", "White", "Whole Grain", or "Whole Wheat"

Whole Wheat

 

-----Sandwich 1-----

PBJ Sandwich

Top Slice:

Bread

Name: Wonder Bread

Calories: 80

Type: whole wheat

Peanut Butter:

Peanut Butter

Name: JIF

Calories: 190

Is Crunchy: true

Jelly:

Jelly

Name: Smuckers

Calories: 100

Fruit Type: Apple

Bottom Slice:

Bread

Name: Wonder Bread

Calories: 120

Type: honey Wheat

 

 

-----Sandwich 2-----

PBJ Sandwich

Top Slice:

Bread

Name: Pepperidge Farm

Calories: 100

Type: Whole grain

Peanut Butter:

Peanut Butter

Name: Peter Pan

Calories: 180

Is Crunchy: true

Jelly:

Jelly

Name: Welch's

Calories: 100

Fruit Type: Grape

Bottom Slice:

Bread

Name: Lender's

Calories: 150

Type: Whole Wheat

 

 

Are they the same sandwich? false

 

Example Dialog 2:

 

-----------------------------------

Welcome to the PBJ Sandwich Maker!

-----------------------------------

-----Sandwich 1-----

Top Slice of Bread Information

Enter name of the bread

Wonder

Enter the number of calories

100

Enter the type of bread. Must be "Honey Wheat", "White", "Whole Grain", or "Whole Wheat"

White

Peanut Butter Information

Enter name of the peanut butter

JIF

Enter the number of calories

150

Is it crunchy? Enter "true", or "false"

false

Jelly Information

Enter name of the jelly

Welchs

Enter the number of calories

150

Enter the type of bread. Must be "Apple", "Blueberry", "Grape", "Strawberry", or "Tomato"

Grape

Bottom Slice of Bread Information

Enter name of the bread

Wonder

Enter the number of calories

100

Enter the type of bread. Must be "Honey Wheat", "White", "Whole Grain", or "Whole Wheat"

White

 

-----Sandwich 2-----

Top Slice of Bread Information

Enter name of the bread

Wonder

Enter the number of calories

100

Enter the type of bread. Must be "Honey Wheat", "White", "Whole Grain", or "Whole Wheat"

white

Peanut Butter Information

Enter name of the peanut butter

JIF

Enter the number of calories

150

Is it crunchy? Enter "true", or "false"

false

Jelly Information

Enter name of the jelly

Welchs

Enter the number of calories

150

Enter the type of bread. Must be "Apple", "Blueberry", "Grape", "Strawberry", or "Tomato"

grape

Bottom Slice of Bread Information

Enter name of the bread

wonder

Enter the number of calories

100

Enter the type of bread. Must be "Honey Wheat", "White", "Whole Grain", or "Whole Wheat"

white

 

-----Sandwich 1-----

PBJ Sandwich

Top Slice:

Bread

Name: Wonder

Calories: 100

Type: White

Peanut Butter:

Peanut Butter

Name: JIF

Calories: 150

Is Crunchy: true

Jelly:

Jelly

Name: Welchs

Calories: 100

Fruit Type: Grape

Bottom Slice:

Bread

Name: Wonder

Calories: 100

Type: White

 

 

-----Sandwich 2-----

PBJ Sandwich

Top Slice:

Bread

Name: Wonder

Calories: 100

Type: white

Peanut Butter:

Peanut Butter

Name: JIF

Calories: 150

Is Crunchy: true

Jelly:

Jelly

Name: Welchs

Calories: 100

Fruit Type: grape

Bottom Slice:

Bread

Name: wonder

Calories: 100

Type: white

 

 

Are they the same sandwich? true

 

Finally:

Upload the all Java source files (.JAVA extension) to the CSCE Dropbox