Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A coffee shop sells 4 products (coffee, tea, bagel and muffin) for $3.65, $2.45, $1.50, and $1.85 each. Write an application that reads a series

A coffee shop sells 4 products (coffee, tea, bagel and muffin) for $3.65, $2.45, $1.50, and $1.85 each.

Write an application that reads a series of product number and quantity sold and generates a final order receipt that includes sold item name, quantity and total for each item as well as the total for the whole receipt including 6% sales tax.

You will need to have two classes, Product and Sales. Product class needs to have its appropriate instance variables, constructor, and setters and getters while Sales class is used as the deriver (test) class and takes care of sales and information display regarding the sale.

Your program should use a switch statement to determine the retail price for each product. It also should use a sentinel-controlled loop to determine when the program should stop looping and display the final results.

image text in transcribed

EL Problems @Javadoc [DeclarationConsole XOError Log LogCat Sales Java Application] C:Program Files'Javajrel.8.0_51\bin\javaw.exe (Sep 15, 2015, 3:51:52 P Our Menu 2 3 4 Coffee Tea Bagel Muffin $3.65 $2.45 $1.50 $1.85 Please enter the product ID from menu(0 to quit and get the receipt): 5 Product number must be 1 to 4 or 0 to quit and get the receipt, please try again Please enter the product ID from menu(0 to quit and get the receipt): 4 Please enter quantity sold for item 4: 2 Please enter the product ID from menu ( to quit and get the receipt): Here is Your Order Reciept: Item Muffin Quanity 2 Total $3.70 $0.22 $3.92 Tax

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

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

Students also viewed these Databases questions

Question

4. Are there any disadvantages?

Answered: 1 week ago