Using java Hamburger Class Write a Hamburger class with the following six attributes: • bun - the type of bun the burger will be on • patties - the number of patties on the burger • cheese - whether or not the burger will have cheese • price - the price of the burger • toppings - an array of five toppings; it will need to start empty Write getters/setters for all attributes except the toppings array. Your constructor should create a single on white with no cheese and no toppings with a price of $2.99. Your class should include the following methods in this order, please: addCheese - this method has no parameters that adds cheese to the burger and increases the price by 75 cents superSizeIt - this method has no parameters and adds a patty to the burger and increases the price by 1.50 addToppings - this method would present the user with at least five toppings (your choice) stored in an array of String objects. If the user indicates the wants the item, store the String in the toppings array. There would be no change in price burgerDetails - this method prints the details of the burger order. It should include whether or not it has cheese, the number of patties, the type of bun, the toppings and the final price Driver Class Write a driver class to test your Hamburger class. Assume you have two visitors to your burger joint. Use your creativity to welcome the customers and take their order. Create an instance of the hamburger class for each customer. For each customer do the following: -1- • ask if he would like cheese, if so, call the addCheese method • ask if he would like to super size the meal, if so, call the superSizeIt method • ask what type of bun he would like and pass that to the setter for your bun attribute • call your addToppings method • call your burgerDetails method to display the details of the burger order It should be exactly the same as screenshots

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

Using java

Hamburger Class
Write a Hamburger class with the following six attributes:
• bun - the type of bun the burger will be on
• patties - the number of patties on the burger
• cheese - whether or not the burger will have cheese
• price - the price of the burger
• toppings - an array of five toppings; it will need to start empty Write getters/setters for all attributes
except the toppings array.
Your constructor should create a single on white with no cheese and no toppings with a price of $2.99.
Your class should include the following methods in this order, please: addCheese - this method has no
parameters that adds cheese to the burger and increases the price by 75 cents
superSizeIt - this method has no parameters and adds a patty to the burger and increases the price by 1.50
addToppings - this method would present the user with at least five toppings (your choice) stored in an array of String
objects. If the user indicates the wants the item, store the String in the toppings array. There would be no change in price
burgerDetails - this method prints the details of the burger order. It should include whether or not it has cheese, the
number of patties, the type of bun, the toppings and the final price
Driver Class
Write a driver class to test your Hamburger class.
Assume you have two visitors to your burger joint. Use your creativity to welcome the customers and take their order.
Create an instance of the hamburger class for each customer. For each customer do the following:
-1-
• ask if he would like cheese, if so, call the addCheese method
• ask if he would like to super size the meal, if so, call the superSizeIt method
• ask what type of bun he would like and pass that to the setter for your bun attribute
• call your addToppings method
• call your burgerDetails method to display the details of the burger order

It should be exactly the same as screenshots

**Order Summary and Customization Process**

**Burger Details for Order 1:**
- **Bun:** Wheat
- **Number of Patties:** 2
- **Number of Cheese Slices:** 1
- **Price of Burger:** $5.24
- **Toppings:** Lettuce, tomatoes, pickles, mayo, mustard

*Customization Process:*

1. **Cheese Addition:** Yes
2. **Supersize Option:** No
3. **Bun Choice:** White
4. **Toppings Selection:**
   - Lettuce: Yes
   - Tomatoes: Yes
   - Pickles: No
   - Mayo: No
   - Mustard: No

**Burger Details for Order 2:**
- **Bun:** White
- **Number of Patties:** 1
- **Number of Cheese Slices:** 1
- **Price of Burger:** $3.74
- **Toppings:** Lettuce, tomatoes

**Note:**
Thank you for your business!

**Operation Status:**
- Indicated as complete by jGRASP.

---

This process outlines the steps and decisions made while customizing burger orders, showcasing the selections and the changes made to the burger ingredients and options. It reflects real-time customization in a simulated environment, confirming the operations as completed successfully.
Transcribed Image Text:**Order Summary and Customization Process** **Burger Details for Order 1:** - **Bun:** Wheat - **Number of Patties:** 2 - **Number of Cheese Slices:** 1 - **Price of Burger:** $5.24 - **Toppings:** Lettuce, tomatoes, pickles, mayo, mustard *Customization Process:* 1. **Cheese Addition:** Yes 2. **Supersize Option:** No 3. **Bun Choice:** White 4. **Toppings Selection:** - Lettuce: Yes - Tomatoes: Yes - Pickles: No - Mayo: No - Mustard: No **Burger Details for Order 2:** - **Bun:** White - **Number of Patties:** 1 - **Number of Cheese Slices:** 1 - **Price of Burger:** $3.74 - **Toppings:** Lettuce, tomatoes **Note:** Thank you for your business! **Operation Status:** - Indicated as complete by jGRASP. --- This process outlines the steps and decisions made while customizing burger orders, showcasing the selections and the changes made to the burger ingredients and options. It reflects real-time customization in a simulated environment, confirming the operations as completed successfully.
**Text Transcription for Educational Website**

---

Title: Understanding Burger Order Programming

---

This text represents the output from a burger ordering program designed to handle multiple orders and customize burger preferences. It showcases a sample interaction between the program and the user to configure two different burger orders. Below is a detailed transcription of the interaction:

1. **Initial Prompt**
   - The program asks: "How many Orders do you have?"
   - The user inputs: `2`

2. **Order Number 1:**
   - The program proceeds with the first order.
   - Options and user responses:
     - Cheese: `y`
     - Supersize: `n`
     - Bun type: `wheat`
     - Toppings: `y` for all (lettuce, tomatoes, pickles, mayo, mustard)
   - Summary for Order 1:
     - Bun: Wheat
     - Number of Patties: 2
     - Number of Cheese Slices: 1
     - Price of Burger: $5.24
     - Toppings: Lettuce, tomatoes, pickles, mayo, mustard

3. **Order Number 2:**
   - The program continues with the second order.
   - Options and user responses:
     - Cheese: `y`

---

This example demonstrates the use of a burger ordering system in a programming context, where users specify various options to receive a detailed summary of their customized burger order. The interaction highlights programming concepts such as user input handling, conditional logic, and output generation.
Transcribed Image Text:**Text Transcription for Educational Website** --- Title: Understanding Burger Order Programming --- This text represents the output from a burger ordering program designed to handle multiple orders and customize burger preferences. It showcases a sample interaction between the program and the user to configure two different burger orders. Below is a detailed transcription of the interaction: 1. **Initial Prompt** - The program asks: "How many Orders do you have?" - The user inputs: `2` 2. **Order Number 1:** - The program proceeds with the first order. - Options and user responses: - Cheese: `y` - Supersize: `n` - Bun type: `wheat` - Toppings: `y` for all (lettuce, tomatoes, pickles, mayo, mustard) - Summary for Order 1: - Bun: Wheat - Number of Patties: 2 - Number of Cheese Slices: 1 - Price of Burger: $5.24 - Toppings: Lettuce, tomatoes, pickles, mayo, mustard 3. **Order Number 2:** - The program continues with the second order. - Options and user responses: - Cheese: `y` --- This example demonstrates the use of a burger ordering system in a programming context, where users specify various options to receive a detailed summary of their customized burger order. The interaction highlights programming concepts such as user input handling, conditional logic, and output generation.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Unreferenced Objects
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
  • SEE MORE 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