Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

you are not writing a FoodApp application . It doesn't need to DO anything. All you need to do is create the shell Java classes,

image text in transcribedimage text in transcribed

you are not writing a FoodApp application. It doesn't need to DO anything. All you need to do is create the shell Java classes, with the needed instance variables and shell methods. The methods don't need any code; the program doesn't need to compile or run.

If you DO want the program to compile (but not run, obviously), you may want to add some dummy return values like:

double getTitalCost() { return 0.0; } 
UML and Java 1. UML to Java Review the following UML Design. Create the Java classes which correspond to these designs. As always, you will need to create one Java file for each class you will be implementing. You do not need to add code to the methods but each method that is supposed to return should return a value of the proper type. For example: int getintval() { return 0; } String getStringVal() { return ""; } MyClass getClassval() { return null; } void noReturnval() {} OrderApp FoodOrder -orderNumber: long +additem(i: Menuitem) +get TotalCost(): double Customer -name: String +chargeCreditCard(): void 1 +main(args: String): void Menuitem +name: String #price: double +getPrice(): double ComboMeal -discount: double +getPrice(: double +additem(i: Menuitem); void Notes: Turn in all source files. There should be five. Make sure your classes are not in a package (that is, they are in the default package). Your source code should all be syntactically correct (no errors). Pay attention to the type of relationship between classes and implement each one appropriately. Watch multiplicities and access specifiers! 2. Java to UML Review the following Java Code for the children's card game called "War". Create the UML class diagram which corresponds to this code. Make sure to account for all the classes, attributes, methods, relationships, access specifiers and multiplicity. You can draw this out by hand and take a picture (be legible!) or use a modelling tool. I use StarUML which can be downloaded for free. War.java public class War public static void main(String[] args) { CardHand playeri - new CardHand(); CardHand player 2 - new CardHand(); Deck d = new Deck(); Card.java public class Card private String suit; private int rank; public void setSuit(String s) { ) public void setRank(int n) { } public int getRank() { } private String rankString(int r) { ) ) CardHand.java public class CardHandt private ArrayList hand; public CardHand() { ) public void addCardToEnd (Card c) { } public Card getCardFromFront() { } public boolean isEmpty() { ) Deck.java public class Deck { private ArrayList cards; public Deck() { } public void shuffle() { > public boolean isEmpty() { ) public Card drawCard() { ) ) Notes: Turn in a single file with your UML model. Pay attention to the type of relationship between classes and implement each one appropriately. Watch multiplicities and access specifiers

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

Was there an effort to involve the appropriate people?

Answered: 1 week ago

Question

18. If you have power, then people will dislike and fear you.

Answered: 1 week ago