Coffee N Roll Sandwich Shop Programming Assignment Answer

“Coffee N Roll Sandwich Shop” Programming Assignment You are to work with a partner, 2 students per group is the maximum. Group must submit for both students, only one copy of the assignment. Submission details are at the end of this document. The assignment has two parts.Problem DescriptionCoffee N Roll is a small-town Sandwich Shop in rural Australia. The population is small so the Sandwich Shop sells only a small but select gourmet products. It sells five products only. Each product has a name and price.The programming team require to demonstrate basic Java programming techniques, specifically using classes and objects. The aim of this assignment is to develop a top-down design and to write a program to be used as a cash register by the Coffee N Roll Sandwich Shop.The assignment is composed of two parts. In Part 1, you are to write a Command Line Interface (CLI) cash register application and in Part 2 you create a Graphical User Interface (GUI) for the same cash register.Part 1 Application RequirementsFor our Java program simulation, a purchase transaction is sale and payment of a single product. For each sale, the program should prompt and get a numbered item corresponding to the product name and quantity of product purchased. The total cost of the purchase should be calculated and displayed. Then the program should ask the amount of money paid bythe customer. The calculated change will be displayed in dollars and cents as well as the currency denominations in banknotes and coins needed to make up the change in the most efficient wayFor example, if the amount of change is $17.35 than the customer would be given 1 ´ ten-dollar banknote, 1 ´five-dollar note, 1 ´ two-dollar coin, 1 ´ twenty-cent piece, 1 ´ ten-cent piece, and 1 ´ five-cent piece.At the end of the day the cashier enters Done to end the simulation. The program should then display the total amount of sales in each of the five categories and terminate. The five product menu is shown if Figure 1.Coffee N Roll Menu  ItemNamePrice1.Schnitzel Roll$18.802.Fish Roll$17.253.Lamb Roll$9.604.Ice Cream Roll$6.755.Coffee Latte$3.406.Done
Figure 1. Coffee N Roll product menu.AnalysisThe program will be launched from the class CoffeeNRoll containing the main( ) method. Product is a good choice for a class with information about products for sale in the Coffee N Roll. The price can be set or updated by calling setPrice( ) method of Product class. Also, we will construct a class Change to return the correct change and currency denominations for a particular sale, by calculating the smallest number of required $100, $50, $20, $10, $5 banknotes and $2, $1, 50c, 20c, 10c, 5c coins.A sample of an UML class diagramsThe public class ProductProduct(String name)//constructor initialises data attributessetPrice(int cents)//sets Product price in cents.addToTotal(int amount) //adds current sale to total, recorded in centsgetName( )//returns the product namegetPrice( )//returns product’s price in centsgetTotal( )//returns day’s sales in centsreset( )//reset attributes (required by GUI app only)The class ChangeChange( )// constructor initialises data attributesdenChange(int amount)//calculate and store currency denominationsgetNotes( )//returns array of banknote denominationsgetCoins( )//returns array of coin denominationsThe class CoffeeNRollmain(String[ ] args)//launch applicationProgram simulate the Coffee N Roll cash register. It will handle all user inputs. The class CoffeeNRoll outline is as follows:import java.util.Scanner; public class CoffeeNRoll{public static void main(String[ ] args){// in main( ) create and initialise all five Product(s), one Change, and other objects//other information which must be stored. See sample run below//format price as currency and pad leading spaces to right justify price//display menu, see samples below//loop until user selects item 6. Done from the Coffee N Roll menu.} //end of main method} //end of class CoffeeNRollData InputProduct name (Schnitzel Roll, Fish Roll, Lamb Roll, Ice Cream Roll, Coffee Latter or Done). Use menu’s item number to select the desired product. A separate class can validate and handle all inputs.QuantityAmount of money received from customer in centsOutputTotal amount of purchase = quantity * product_priceChange returned to customer = amount tendered – amount purchased)In addition to the amount of change, display the number of hundred-dollar, fifty-dollar, twenty- dollar, ten-dollar and five-dollar notes, two-dollar coins, one-dollar coins, fifty-cent, twenty-cent, ten-cent and five-cent coins.Use printf( ) to align on right (right justify) the menu’s price column.At the end of the day (menu item 6. Done entered) display the total dollars of sales for each of the five product categories and totals for the day.Note: All money data will be stored in cents but displayed as dollars.cents. This avoids rounding problems. All data input should request the cent value. (This is actually what happens with a real cash register when the cashier enters 2000 for $20 then hits “00 key” provided on the keyboard for dollar entry. If you tender$20.50 the cashier enters 2050.A sample output1. Schnitzel Roll$18.802. Fish Roll$17.253. Lamb Roll$14.604. Ice Cream Roll$6.755. Coffee Latte$3.406. Done
Enter the item number you want to order: 1 Enter quantity ordered: 3Sale price: $56.40Enter the amount paid in cents [0-1000000]: 10035 The change is: $43.95The change returned to the customer is:| Number of 20 dollar notes:2 || Number of 2 dollar coins:1 || Number of 1 dollar coins:1 || Number of 50 cents coins:1 || Number of 20 cents coins:2 || Number of 5 cents coins:1 |1. Schnitzel Roll$18.802. Fish Roll$17.253. Lamb Roll$14.604. Ice Cream Roll$6.755. Coffee Latte$3.406. Done
Enter the item number you want to order: 5 Enter quantity ordered: 8Sale price: $27.20Enter the amount paid in cents [0-1000000]: 5000 The change is: $22.80The change returned to the customer is:| Number of 20 dollar notes:1 || Number of 2 dollar coins:1 || Number of 50 cents coins:1 || Number of 20 cents coins:1 || Number of 10 cents coins:1 |Sale 1Sale 21. Schnitzel Roll$18.802. Fish Roll$17.253. Lamb Roll$14.604. Ice Cream Roll$6.755. Coffee Latte$3.406. DoneEnter the item number you want to order: 1 Enter quantity ordered: 2Sale price: $37.60Enter the amount paid in cents [0-1000000]: 5055 The change is: $12.95The change returned to the customer is:| Number of 10 dollar notes:1 || Number of 2 dollar coins:1 || Number of 50 cents coins:1 || Number of 20 cents coins:2 || Number of 5 cents coins:1 |1. Schnitzel Roll$18.802. Fish Roll$17.253. Lamb Roll$14.604. Ice Cream Roll$6.755. Coffee Latte$3.406. Done

Enter the item number you want to order: 3 Enter quantity ordered: 3Sale price: $43.80Enter the amount paid in cents [0-1000000]: 11075 The change is: $66.95The change returned to the customer is:Number of 50 dollar notes:1Number of 10 dollar notes:1 Number of 5 dollar notes:1 Number of 1 dollar coins:1Number of 50 cents coins: 1Number of 20 cents coins: 2Number of 5 cents coins: 1Sale 3Sale 41. Schnitzel Roll$18.802. Fish Roll$17.253. Lamb Roll$14.604. Ice Cream Roll$6.755. Coffee Latte$3.406. DoneEnter the item number you want to order: 4 Enter quantity ordered: 7Sale price: $47.25Enter the amount paid in cents [0-1000000]: 10000 The change is: $52.75The change returned to the customer is:Number of 50 dollar notes:1 Number of 2 dollar coins:1 Number of 50 cents coins:1 Number of 20 cents coins:1 Number of 5 cents coins:1 Sale 51. Schnitzel Roll$18.802. Fish Roll$17.253. Lamb Roll$14.604. Ice Cream Roll$6.755. Coffee Latte$3.406. Done
Enter the item number you want to order: 6Total Schnitzel Roll Sales: $94.00 Total   Fish Roll Sales:   $0.00 Total  Lamb Roll Sales:   $43.80 Total Ice Cream Roll Sales: $47.25 Total   Coffee Latte Sales:   $27.20TotalDaily Sales:$212.25End of day tradingEnd of the day Sales summaryPart 2: GUI ApplicationDesign a GUI application to manage the Coffee N Roll sandwich shop. The GUI needs to be able to accomplish the same input and output tasks as the command line driven program was able to do.The appearance of the GUI is entirely up to you to decide. Feel free to add any extra features that you feel are useful.Note: Do not rewrite any of the classes from Part 1 of the assignment. Rather you will create instances of the relevant classes when you need them for Part 2. The GUI for this assignment should create at least two new classes one being the JFrame and the other CashRegGUI JPanel with its components.import javax.swing.*;//Create JFrame container public class CNR_GUI {public static void main(String[] args) {//main method JFrame frame = new JFrame(“CashReg”);                                                      //create GUI panelframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(new CashRegGUI()); frame.pack();frame.setVisible(true);} //end of main} //end CNR_GUIChoose GUI components that reduce user errors and provide a feedback to the user. For example,Cell 5 panel subdivided
2Quantity3as GridLayout(5, 1)
3Paid (cents)10035

4Change$43.95
Figure 2. Basic Cash Register GUI application layoutConsider the following controls as a minimum requirements as shown in Figure 2:Reset button to clear and enable all fields. total for each product set 0. Do not clear product prices!Done button lists day trading summary in Cell 6 text area.Text field to display warnings and user errors (pink background text field in Sub-Cell 1, in Figuew 2).Sale, Quantity, Paid and Change text field display sale price, product quantity, cash tendered and change.Two text area to display denomination of change (Cell 4) and day trading summary (Cell 6).Full marks will be given for a completely functional basic layout but additional marks may be given by better working GUI.Figure 3. Screen image of the fully working Java GUI application What do you have to hand in?An electronic copy ofReadme.docx file with information on how to run your program. Include any extra information about your design and program that you wish the marker to know.Summary of tasks allocations—who did what?A word document with the evidence of trial runs of your program, i.e., jGRASP console output for CLI app or screen printouts of GUI results where you have tested all the features of your code.UML diagram for all classes in your program.Code for all the classes that has been compiled and are ready to run. (jGRASP will be used to run and test your application).A brief description of the class. At the start of each method, there should be a comment clearly describing what the method does.Each class should be fully documented commencing with a heading. In particular, the heading should include your name, unit, assignment details, date written and a brief description of the class. At the start of each method, there should be a comment clearly describing what the method does. If you have a partner, their name and student number is should be clearly identified in the heading beside your name.

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
Open chat
1
You can contact our live agent via WhatsApp! Via + 1 929 473-0077

Feel free to ask questions, clarifications, or discounts available when placing an order.

Order your essay today and save 20% with the discount code GURUH