Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

UML diagram to Java code I am having a hard time with the room and door class to transform it from UML diagram to JAVA

UML diagram to Java code I am having a hard time with the room and door class to transform it from UML diagram to JAVA CODE. The human class and Thing class does not need to be coded but the room

class and door class needs to be coded. Here is what I have for world class so far, if you think it needs fixing, please fix it:

public class World{ private ArrayList rooms; //constructor public World(){ //arrayList for type Room rooms = new ArrayList(); } public void addRoom(Room room){ //add room object into arrayList room rooms.add(room); } public ArrayList getRooms(){ return room; } public String toString(){ /* *will show info on each room */ String info = ""; for(int i= 0; i

image text in transcribed

image text in transcribedimage text in transcribedimage text in transcribed

World - rooms: ArrayList + World0 +addRoom(room Room) +getRooms() ArrayList + toString(): String

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

Step: 3

blur-text-image

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

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions

Question

a. What is the purpose of the team?

Answered: 1 week ago

Question

How is the NDAA used to shape defense policies indirectly?

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago