Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is in Java. IceStand Class: This class has two properties: name & location (both are strings). Create the corresponding Mutators (set methods) with this

This is in Java.

IceStand Class: This class has two properties: name & location (both are strings). Create the corresponding Mutators (set methods) with this specification: setName: coverts the shaved ice stand name received as parameter to all capital letters, add the words SHAVED ICE, & concatenate it with the underline according to the example below. This new string is assigned to the name property. setLocation: based on the zip code received as parameter (a string), assign the city to the location property: 51558 Butonsville, 51555 Dunburton, 51537 Fairmont, Other value FIlmore Constructor: Create only one constructor that receives as parameters the name of the shaved ice stand, & the zip code (string). In this constructor, call the corresponding mutators (setters), so the properties can be set up. toString Method: return a string with the name & location (first three lines of the bill). Snowball Class: This class has the following properties: size (type: string) quantity (type: integer) unitPrice (type: double) totalPrice (type double) In addition, it will have a constant: TAX_RATE (static). CPIT 102 into programming School of Tech & Art Campus: Fairmont Department Telephone: 555-555-5555 Project Three Page 2 Constructor: In this case create an empty constructor (all the properties initialized to zero or null). calculatePrice Method: this method will receive the size, quantity, & unit price of the snowball sold as parameters. It will set the size, quantity, & unit price (set up the properties values of the object) & calculate the total price. It will also return the total price calculated. toString Method: will return the string composed by the size, quantity, unit price, & total price. Please format the prices using the currency format. You should create the Format object inside of the method. calculateTax Method: this method will return the value of the tax based on the total sent to it as parameter. This method should be static. With the two classes you created, test them by creating the ShavedIceStand.java demo: The prices for each size are as follow: Small $ 1.25 Medium $ 2.40 Large $ 3.55 You should follow the following steps: Ask the user for the name of the shave ice stand, & the zip code (remember that this value is a string). Use the IceStand class to set the name & location values (instantiate an object of this class) Create a while loop with sentinel value (quantity for small is -1). Once the user enters the number of small, medium, & large snowballs sold in this transaction, display the title of the bill. Use the Snowball class to instantiate three objects smallSnowball, mediumSnowball, largeSnowball, & calculate the total for each one of them Display the detail of the bill, including the subtotal. Calculate (using the static method) & display the tax for the whole bill. Calculate & display the total of the bill. In each iteration of the loop: print the title of the bill, the detail, the tax, & the total bill.

Thanks!

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_2

Step: 3

blur-text-image_3

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

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

In what ways do organisations possess knowledge?

Answered: 1 week ago