Java code for the Sundae class and then the driver program.
Sundae Class: contains the following attributes/properties:
Sundae Class: contains the following attributes/properties: iceCreamFlavor: can be: vanilla, peanut butter, chocolate, chocolate chip, mint chocolate chip, cookie dough, mint moosetracks, coconut, pineapple, cotton candy, moosetracks , Oreo cookies and cream. Vanilla is the default
numberOfScoops: choice of 1, 2, 3, 4, 5, 6, 8,11 and 42.
costForScoops: One scoop: 1.79; Two: 2.79; Three: 3.79; Four: 4.79 (See the pattern??)
standardToppingList:a list of the Standard toppings at no extra cost that would be: whipped cream, syrup, sprinkles (chocolate or rainbow), and a cherry
freeSyrupChoice: Free syrup is included with the sundae. Choices are: hot fudge, chocolate, and caramel
deluxeToppingList: a list of toppings at an extra cost. That would be: M&Ms, Crushed Oreos, Reeses, chocolate chips, toasted coconut, pistachios, Gummy bears, peanuts and/or walnuts.
counterD: for the number of deluxe toppings
costOfSundae:the cost of the sundae
costOfDeluxeToppings: Cost is $1.25 for each
Methods: sets and gets for each of the attributes/properties. Include a no-argument constructor that defaults to 2 scoops of VANILLA ice cream with the standard toppings (whipped cream, hot fudge syrup, multi-colored sprinkles, and a cherry). Include a toString and equals methods.
In your driver program:
Ask the user for their choices. If the input is invalid, then the program will use the default value. Specifically, 2 scoops of ice cream with the standard toppings (whipped cream, hot fudge syrup, multi-colored sprinkles, and a cherry).
Your program will display the entire order.
Your program should calculate: sub-total amount, amount of tax (8.625%) AS A CONSTANT, and grand total. The money output should have both a $ and 2 decimal places.
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference
and should not be submitted as is. We are not held liable for any misuse of the solutions.
Please see the frequently asked questions page
for further questions and inquiries.
Kindly complete the form.
Please provide a valid email address and we will get back to you within 24 hours.
Payment is through PayPal, Buy me a Coffee
or Cryptocurrency.
We are a nonprofit organization however we need funds to keep this organization operating
and to be able to complete our research and development projects.