Question: Assignment 9.1: Java Jive Pastries and Cafe (10 pts) Open a new class called Pastries.java . This program will simulate an online pastry business and

Assignment 9.1: Java Jive Pastries and Cafe (10 pts)

  • Open a new class called Pastries.java.
  • This program will simulate an online pastry business and display a receipt to the customer who has placed an order.
  • The program should follow the exact formatting shown below, including spacing and indentation.
    • Hint: Remember "\t"?
  • Note that you will need to print out exactly 2 decimal places for the dollar values.
  • Additionally, for full credit, please use final variables to store the price of each pastry. For example:

final double PRICE_ECLAIR = 3.95; //use all CAPS for the names of final variables

  • When your program output works as shown below (including proper formatting of the output), submit Pastries.java to Canvas
  • Note: Listen to the Java Jive song here.

Sample Output:

Welcome to Java Jive Pastries and Cafe! Allow me to assist you with your order. We sell the following desserts: Mocha Eclairs -- $3.95 each Cocoa Cookies -- $2.50 each Coffee Cake -- $5.50 per slice Java Jive Brownies -- $4.50 each Please enter the number of Mocha Eclairs: 3 Please enter the number of Cocoa Cookies: 12 Please enter the number of slices of Coffee Cake: 1 Please enter the number of Java Jive Brownies: 5 You Ordered the Following: Mocha Eclairs: 3 @ 3.95 each... $11.85 Cocoa Cookies: 12 @ 2.50 each... $30.00 Coffee Cake: 1 @ 5.50 each... $5.50 Java Jive Brownies: 5 @ 4.50 each... $22.50 Total: $69.85 Thank you for your order! Please come again!

  • Note that \t is not a perfect solution for lining up the output in the case of every numerical input. Just do the best you can, and don't worry if something like a single digit number throws off your alignment.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!