Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 5 -Hamburger For this assignment, you will create an application for a hamburger restaurant. Name this folder Assignment5 Include comments at the top of

Assignment 5 -Hamburger

For this assignment, you will create an application for a hamburger restaurant.

Name this folder Assignment5

Include comments at the top of both of your Java files that include your name, course, assignment, and due date. For example, the top of my application may look like:

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 1.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 50 cents

superSizeIt - this method has no parameters and adds a patty to the burger and increases the price by 1.00

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:

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

Be sure to compile and run your application. Take a screenshot of your successful test run.

Deliverable

ZIP THE FOLDER YOU CREATED WITH YOUR FILES IN IT.

Submit this zipped folder and your screenshot to the appropriate dropbox.

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

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions