Complete the UML Class Diagram for the Vending Machine Program as it is given , using Visual
Fantastic news! We've Found the answer you've been seeking!
Question:
- Complete the UML Class Diagram for the Vending Machine Program as it is given, using Visual Paradigm.
- Suggest two design improvements by referring to at least two principles of Object-Oriented Design discussed in class. Explain your choices in writing.
Transcribed Image Text:
package midtermreview; import java.util.Scanner; public class Vending MachineItem { public double price; public static String [] candies = {"chocolate bar", "sour candy", "soft drink", "potato chips"}; public VendingMachineItem() { //intentionally left blank } public double getPrice() { } return price; public void setPrice (double givenPrice) { price = givenPrice; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Welcome to the vendin machine, here is a list of the possible candies"); for(int i=0; i<candies.length; i++) { System.out.println(candies[i]); } System.out.println("To re-fill the vending machine, please follow instructions in program 2"); //there is no program 2 because we haven't created an approprite design for this code yet! package midtermreview; import java.util.Scanner; public class Vending MachineItem { public double price; public static String [] candies = {"chocolate bar", "sour candy", "soft drink", "potato chips"}; public VendingMachineItem() { //intentionally left blank } public double getPrice() { } return price; public void setPrice (double givenPrice) { price = givenPrice; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Welcome to the vendin machine, here is a list of the possible candies"); for(int i=0; i<candies.length; i++) { System.out.println(candies[i]); } System.out.println("To re-fill the vending machine, please follow instructions in program 2"); //there is no program 2 because we haven't created an approprite design for this code yet!
Expert Answer:
Answer rating: 100% (QA)
Solution I can provide you with a textual description of a UML class diagram for the Vending Machine program youve given along with two design improve... View the full answer
Related Book For
Management Accounting Information for Decision-Making and Strategy Execution
ISBN: 978-0137024971
6th Edition
Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young
Posted Date:
Students also viewed these operating system questions
-
Create your own new decision criterion for decision making under uncertainty that is logical but not exactly the same as the five criteria described in Section 8.4. (a) Describe the rule in complete...
-
Let M be the Turing machine defined by 8 90 91 92 B 91, B, R 91, B. R 91, a, R 92, b, L b 91, b, R 92, a, L 92, C, L a) Trace the computation for the input string abcab. b) Trace the first six...
-
Recently, you needed money and agreed to sell a car you had inherited at a price of $45,000 , to be paid in monthly payments of $1,300 for 45 months . What (annual) interest rate did you charge for...
-
. 4. Bank overdrafts repayable on * 1 point demand may be included in the cash and cash equivalent balance. True O False
-
Does the statement of Clausius require a constant T for the heat transfer as in a Carnot cycle?
-
As in most kitchens, the baking ovens in Lori's Kitchen in New Orleans are located in one area near the cooking burners. The refrigerators are located next to each other as are the dishwashing...
-
Consider the ammonia process in which \(\mathrm{N}_{2}\) and \(\mathrm{H}_{2}\) (with impurities \(\mathrm{Ar}\) and \(\mathrm{CH}_{4}\) ) are converted to \(\mathrm{NH}_{3}\) at high pressure...
-
Cray-Z Consultants provides management accounting advice to not-for-profit-firms. It employs three levels of consultants, based on experience and education: partner, senior, and associate. When...
-
Explain the significance of multi-scale modeling in process simulation. How does the integration of different scales, from molecular to plant-level simulations, provide a comprehensive view of...
-
a. Write an application that extends JPanel and displays your name. Place boxes of different colors around your name at intervals of 10, 20, 30, and 40 pixels. Save the file as JBorderPanel.java. b....
-
Describe the judgmental and statistical approaches of collecting and combining the applicant data. Which approach would you prefer and why?
-
The following is the information: Plan: Mean Expense Percentage of Free Plan Free 42.2 - 25% 28.4 67% 50% 13.1 33% 95% 18.1 43% The table is provided above I am asked to calculate the arc elasticity...
-
Consider the AD-AS model discussed during the lectures. Assume that the aggregate demand curve is given by Y=8-0.5, that the long run aggregate supply curve is given by Yp=7, that the short run...
-
You are the Field Training Officer (FTO) for a large criminal justice organization and are tasked with the responsibility of training newly promoted supervisors. Your boss has asked for you to...
-
How we need to understand everyone involved with determining project success, as project success is multi-dimensional. For this discussion entry, think back to a project you were involved in or are...
-
How does the "Trade-Off Theory" influences the decision-making process for companies? Aside from the Trade-Off Theory, what other factors tend to limit the amount of debt a company issues? Generally...
-
Name some of the content marketing tactics to attract clients and increase ROI.
-
Find the reduced echelon form of each of the matrices given in Problems 120. c 1 26 + 4
-
Shelf mix decision Superstore is a large discount supermarket. Profits have declined, so the manager has collected data on revenues and costs for different food categories. The following data pertain...
-
The Hillman Company sells and services lawn mowers, snow blowers, and other equipment. The service department uses a job order cost system to determine the cost of each job, such as oil changes,...
-
Provide examples of how management accounting systems have changed in response to information needs as companies have become more complex, technologies have changed, or new competitors have appeared.
-
Testing \(H_{0}: p_{1}=p_{2}\) vs \(H_{a}: p_{1}>p_{2}\) using \(\hat{p}_{1}-\hat{p}_{2}=0.8-0.7=0.10\) with each of the following sample sizes: (a) \(\hat{p}_{1}=24 / 30=0.8\) and \(\hat{p}_{2}=14 /...
-
100 tests conducted using a significance level of \(5 \%\). We are conducting many hypothesis tests to test a claim. In every case, assume that the null hypothesis is true. Approximately how many of...
-
Testing \(H_{0}: p=0.5\) vs \(H_{a}: p>0.5\) using \(\hat{p}=0.55\) with each of the following sample sizes: (a) \(\hat{p}=55 / 100=0.55\) (b) \(\hat{p}=275 / 500=0.55\) (c) \(\hat{p}=550 /...
Study smarter with the SolutionInn App