Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

UML is required for this program Partial credit will be given in the program if you comment your code and I can see you had

image text in transcribed
UML is required for this program Partial credit will be given in the program if you comment your code and I can see you had the right idea even if it is not working correctly. It is better to write comments for parts of the program you cannot figure out than to write nothing at all Read the directions for the program carefully before starting. Make sure and ask if the directions are unclear You need to help an ambitious kid get ready for summer with a lemonade stand - with two flavors and an optional cookie. Create a class called Lemonade that has the following attributes: Lemonade flavor-string .Lemonade price- double Optional cookie-boolean The class should have the following overloaded constructors: Constructor that takes the lemonade flavor and lemonade price and sets optional cookie to false Default constructor that sets the flavor to empty string, price to 0 false and optional cookie to Make constants for sales tax of 8.5% (or 0085) and price of a cookie of 199 (only one type of cookie). Write Get and Set methods for each attribute: flavor, price, and cookie. Do not allow the price to be less than Have a chargeTax function with no parameters but calculates the sales tax of 0.085 (use constant) on the price or the price + cookie (check the boolean) .Have a printReceipt (no prameters) that prints a receipt for the order of lemonade (print flavor and price) and sales stax (call the chargeTax) Use a loop to drive a menu to access the drinks and do the ordering. Note: use the data members and get functions wherever the flavor, price, and optional cookie are used. Do NOT hard code the information printed (should be able to change the objects at any time) Create the program with flavorl and flavor2. Have flavorl use the default constructor then use the set methods to set the flavor and price. Have flavor2 use the constructor that takes the flavor and price ac

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

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions