Home / Expert Answers / Computer Science / translate-into-java-the-following-uml-class-diagram-the-pizzaboom-class-represents-a-pizzeria-and-pa739

(Solved): Translate into java the following UML class diagram. The PizzaBoom class represents a pizzeria and ...




Translate into java the
following UML class diagram. The PizzaBoom class represents a pizzeria and the
Pizza class represents
logSales: writes the content of the arrays menu and quantitySold in a text file using Print Writer
and the format of the foll
Translate into java the following UML class diagram. The PizzaBoom class represents a pizzeria and the Pizza class represents a type of pizza that belongs to the pizzeria's menu. Pizza PizzaBoom -quantitySold: Integer[] -menu 1n - variety: string -size: integer + PizzaBoom(size: integer) +Pizza(var: string, sze: integer) + sellPizza(var: string, sze: integer, nbsold: Integer) + logSales(fileName: string) +displaySalesFromFile(fileName: string) + storelnObjectFile(fileName: string) +displayMenuBySizeFromFile(fileName: string, minSize: Integer) Pizza class attributes variety: the pizza variety. For example: mexican, vegetarian, etc. size: means the pizza size. For example: 6 inch, 12 inch, etc. PizzaBoom class attributes menu: array that contains the pizzeria's menu quantitySold: array that contains the number of sold pizza for each pizza type. The index in quantitySold corresponds to the index of pizza type in menu. Example: the quantity of pizza sold is: 345 of mexican 12 inch, 187 of mexican 6 inch, and 59 of vegetarian 5 inch. menu quantitySold mexican 12 mexican 6 vegetarian 5 345 187 59 PizzaBoom class methods sellPizza: when pizza is sold, this method receives the following parameters: var: the pizza variety O sze: the pizza size O nbSold: the number of pizza sold The method updates the array quantitySold by adding nbSold. Example: we sold 4 of vegetarian 5 inch pizza, sellPizza will add 4 to 59 to become 63. logSales: writes the content of the arrays menu and quantitySold in a text file using Print Writer and the format of the following example: Pizza type Size Quantity mexican 12 345 mexican 6 187 vegetarian 5 63 displaySalesFromFile: reads the text file created by logSales and displays that content on the screen. storeInObjectFile: writes the content of the menu array in a file of objects. displayMenuBySizeFromFile: reads the file of objects created by storeInObjectFile and displays on the screen the pizza types whose size is greater than minSize. Example, if minSize equals 5, this method should display on the screen: mexican 12 mexican 6 P.S You need to provide the full Java code (including the implementation of the methods)


We have an Answer from Expert

View Expert Answer

Expert Answer


Go through the soution and feel free to comment for any futher help. A brief note on the solution: Function storeInObjectFile() state that it writes objects to file and this is assumed that which meant the file will be an object output stream file he
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe