Case Diagram and UML Class Diagram for this java code : (Below the code give some constructive critiques about the UML class diagram)…. Thanks   import java.util.*; public class BeverlyBreads{public static void main(String[] args){Scanner input = new Scanner(System.in); //Array for breads String[] breads = new String[5];   //Bread choices breads[0] = "White Bread"; breads[1] = "Wheat Bread"; breads[2] = "Rye Bread"; breads[3] = "Pumpernickel Bread"; breads[4] = "Baguette";   //Prices for the breads double[] prices = new double[5]; prices[0] = 2.99; prices[1] = 3.49; prices[2] = 3.99; prices[3] = 4.49; prices[4] = 4.99;   //Customer's Name System.out.println("Enter customer's name: "); String name = input.nextLine(); //Customer's Phone Number System.out.println("Enter customer's phone number: "); String phoneNumber = input.nextLine(); //Bread Selection System.out.println("Which bread would you like to order?"); for(int i = 0; i < breads.length; i++) { System.out.println(breads[i] + " " + prices[i]); } int breadSelection = input.nextInt(); switch(breadSelection) { case 1: System.out.println("You've selected " + breads[0] + " " + prices[0]); break; case 2: System.out.println("You've selected " + breads[1] + " " + prices[1]); break; case 3: System.out.println("You've selected " + breads[2] + " " + prices[2]); break; case 4: System.out.println("You've selected " + breads[3] + " " + prices[3]); break; case 5: System.out.println("You've selected " + breads[4] + " " + prices[4]); break; default: System.out.println("You've made an invalid selection"); break; } //Confirmation Page System.out.println("Name: " + name); System.out.println("Phone Number: " + phoneNumber); System.out.println("Bread Selection: " + breads[breadSelection - 1]); System.out.println("Price: " + prices[breadSelection - 1]); } }

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 14RQ
icon
Related questions
Question

Case Diagram and UML Class Diagram for this java code : (Below the code give some constructive critiques about the UML class diagram)…. Thanks

 

import java.util.*; public class BeverlyBreads{public static void main(String[] args){Scanner input = new Scanner(System.in); //Array for breads String[] breads = new String[5];

 

//Bread choices breads[0] = "White Bread"; breads[1] = "Wheat Bread"; breads[2] = "Rye Bread"; breads[3] = "Pumpernickel Bread"; breads[4] = "Baguette";

 

//Prices for the breads double[] prices = new double[5]; prices[0] = 2.99; prices[1] = 3.49; prices[2] = 3.99; prices[3] = 4.49; prices[4] = 4.99;

 

//Customer's Name System.out.println("Enter customer's name: "); String name = input.nextLine(); //Customer's Phone Number System.out.println("Enter customer's phone number: "); String phoneNumber = input.nextLine(); //Bread Selection System.out.println("Which bread would you like to order?"); for(int i = 0; i < breads.length; i++) { System.out.println(breads[i] + " " + prices[i]); } int breadSelection = input.nextInt(); switch(breadSelection) { case 1: System.out.println("You've selected " + breads[0] + " " + prices[0]); break; case 2: System.out.println("You've selected " + breads[1] + " " + prices[1]); break; case 3: System.out.println("You've selected " + breads[2] + " " + prices[2]); break; case 4: System.out.println("You've selected " + breads[3] + " " + prices[3]); break; case 5: System.out.println("You've selected " + breads[4] + " " + prices[4]); break; default: System.out.println("You've made an invalid selection"); break; } //Confirmation Page System.out.println("Name: " + name); System.out.println("Phone Number: " + phoneNumber); System.out.println("Bread Selection: " + breads[breadSelection - 1]); System.out.println("Price: " + prices[breadSelection - 1]); } } 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Concept of pointer parameter
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT