-There will be three java files: Room class, Dungeon class, Main method(tester file) -Please make sure it...
Fantastic news! We've Found the answer you've been seeking!
Question:
-There will be three java files: Room class, Dungeon class, Main method(tester file)
-Please make sure it compiles
Transcribed Image Text:
Room Room description: String north: Room east: Room west: Room south: Room <<Constructor>> Room (description: String) + setNorth (north: Room) + setEast (east:Room) + setWest (west:Room) + setSouth(south:Room) + setExits(n: Room, e:Room, w: Room, s:Room) + getNorth(): Room getEast(): Room getwest(): Room + getSouth(): Room + getDescription(): String +getExits(): String toString(): String UML class diagram for Room Dungeon Dungeon balcony: Room bedroom1: Room bedroom2: Room dining: Room kitchen: Room northHall: Room southHall: Room <<Constructor>> Dungeon() +getRoom@(): Room Room Class Rooms are responsible for representing an area in the dungeon. The properties that define a room are its description and its exits. The room description may be stored using a String. For the exits, this room can hold references to other rooms that connect to it. The room constructor only sets up its description leaving its exits initially null. Client code can then update the room's properties with getter and setter methods. It would be convenient to also have a method that can set all 4 exits at once. The room's description shouldn't say its exits; instead have a method (getExits) that creates a String of exits. The toString method should contain the description and the exits. Dungeon Class The dungeon is responsible for setting up all the rooms and establishing the connections between them. The dungeon's properties (i.e. instance variables) are the rooms that it contains. The dungeon constructor should initialize all of the rooms' descriptions and its exits. The only method that our dungeon needs is to provide the starting room. Once we have the starting room we can navigate to any other room from using the rooms themselves. Room Room description: String north: Room east: Room west: Room south: Room <<Constructor>> Room (description: String) + setNorth (north: Room) + setEast (east:Room) + setWest (west:Room) + setSouth(south:Room) + setExits(n: Room, e:Room, w: Room, s:Room) + getNorth(): Room getEast(): Room getwest(): Room + getSouth(): Room + getDescription(): String +getExits(): String toString(): String UML class diagram for Room Dungeon Dungeon balcony: Room bedroom1: Room bedroom2: Room dining: Room kitchen: Room northHall: Room southHall: Room <<Constructor>> Dungeon() +getRoom@(): Room Room Class Rooms are responsible for representing an area in the dungeon. The properties that define a room are its description and its exits. The room description may be stored using a String. For the exits, this room can hold references to other rooms that connect to it. The room constructor only sets up its description leaving its exits initially null. Client code can then update the room's properties with getter and setter methods. It would be convenient to also have a method that can set all 4 exits at once. The room's description shouldn't say its exits; instead have a method (getExits) that creates a String of exits. The toString method should contain the description and the exits. Dungeon Class The dungeon is responsible for setting up all the rooms and establishing the connections between them. The dungeon's properties (i.e. instance variables) are the rooms that it contains. The dungeon constructor should initialize all of the rooms' descriptions and its exits. The only method that our dungeon needs is to provide the starting room. Once we have the starting room we can navigate to any other room from using the rooms themselves.
Expert Answer:
Answer rating: 100% (QA)
For Room public class Room private String name private String description private Room north private ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Action Industries, a home products manufacture, had conducted an extensive recruitment campaign to fill a Director of Human Resources position. This position requires a thorough understanding of...
-
In the United States, a principal responsibility for preserving endangered species (e.g., a pair of endangered birds that chooses to nest on private land) and the costs of exercising that...
-
On what distribution does one-way ANOVA rely?
-
Use Conditional Proof (C.P.) to prove that the following statements are tautologies. [(A B) A] A
-
Almetals, Inc., a Michigan company, entered into a contract with the German firm Wickeder Westfalenstahl regarding the purchase of clad metal, a specialty metal used in a variety of industries but...
-
Marston Corporation manufactures disposable thermometers that are sold to hospitals through a network of independent sales agents located in the United States and Canada. These sales agents sell a...
-
n Juods xi(yi - Bxi) = 0 n i=1 a) Step by step, solve for B (Hint: you may want to use the proof starting on pg 10 as your guide)
-
The following diagram is the original plan for a project. In reference to the diagram below answer the questions below. All durations are in weeks. DESIGN STRUCTURAL 37CCL 8.1 8.2 8.3 8.4 8.5 2...
-
On this work sheet, list as many of the incidents of cultural misalignments, mistakes and miscues that occur in the MOTO case. Mention the occurrence under collinn one, then indicate briefly what was...
-
Pick a Professional Certification that can be achieved with an Accounting or Finance Degree and answer the following questions: What level of education is required? How many parts are included in the...
-
why are commercial banks important to commerce and industry?
-
Which KPI assesses the difference between the budgeted cost of work performed and the actual cost of work performed in a project?
-
John Doe, CPA, is interested in testing the fairness of the ending inventory balance during the audit of ABC Co. John has relatively little experience using statistical sampling methods and, quite...
-
A tech company recently looked at the makeup of their departments and discovered that the programming department was primarily staffed with men but the customer service department seemed to be...
-
The comparative financial statements prepared at December 31, 2017, for Pinnacle Plus showed the following summarized data: 2017 2016 Income Statement Sales Revenue Cost of Goods Sold $ 130,000...
-
Use the T account for Cash below to record the portion of each of the following transactions, if any that affect cash. How do these transactions affect the companys liquidity? Jan. 2 Provided...
-
In Gas Pump, South Dakota, there are two kinds of consumers, Buick owners and Dodge owners. Every Buick owner has a demand function for gasoline DB (p) = 20 5p for p 4 and DB (p) = 0 if p > 4....
-
The price elasticity of demand for oatmeal is constant and equal to 1. When the price of oatmeal is $10 per unit, the total amount demanded is 6,000 units. (a) Write an equation for the demand...
-
Douglas Cornfields preferences are represented by the utility function u(x 1 , x 2 ) The prices of x1 and x2 are p1 and p2. (a) The slope of Cornfields indifference curve at the point (x 1 , x 2 ) is...
-
Provide an overview of the behavioral finance perspectives of risk.
-
Define the heuristic biases of representativeness, anchoring, and mental accounting.
-
List and explain some fundamental issues of behavioral finance.
Study smarter with the SolutionInn App