MansionDriver.java This will be your driver class. You should prompt the user for input to determine: 1. A name for the Player. 2. A size for the mansion (positive whole number). If 10 is given, for example, the mansion will be 10x10. 3. The percentage of rooms which should contain monsters (out of 100). If 20 is given, for example, 20% of the rooms in the mansion will contain monsters. 4. The number of rooms which should have Scooby Snacks. You will use this information to create your mansion's room layout. Create a 2D array of Rooms with its dimensions determined by the given size. Then fill each spot with a new Room. For now, every room will have no monster and not contain Scooby Snacks. Now you can use the HauntedHelper class to help you fill in the details. Make a HauntedHelper instance and provide its constructor with the array you have created. You can use the selectGoal Room method to pick and store the goal room of the mansion. Calculate the number of rooms which will have monsters based on the given percentage and size. This many times, you should call the placeMonster method on the HauntedHelper to place a monster (it will be one of the three possible types) in a room which does not already have one. Similarly, for each room which should have a Scooby Snack, call the placeSnack method on the Haunted Helper to place a snack in a room which does not already have one. Now your mansion layout is complete! Go ahead and construct the Haunted Mansion, run your program, and try to escape the mansion!

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
be putting them
in one! You will set the stage for their newest adventure, a lexd-based command line adventure
game, in which the
gang must escape a Haunted Mansion.
You will define several classes and hierarchies that take advantage of object-oriented concepts to
bandle the different events and scenarios in your mansion. This will include a set of Rooms,
Monsters, and a Player
the arrangement, or Loorplan, of rooms. A Player always begins in the middlemost Room of the
mansion. An exit toom will be specia. ly designated. "The layer can move left, right, up, or down
one slep (Room) during each round of the game. The Player begins the game with a love
immediately lose the game.
Player enters a Room, they may encounter a Monster. Á Monster encounter will take a toll on a
layer's courage. Monsters come in different varieties, and their respective effects on players
ou will have a base Monster class and some subclasses to create different types of
Monsters.
While the scary monsters are there to thwart you, fortunately there will be Scooby Snacks in a
Player's courage.
The data members for your classes should be only accessible via appropriate setier and getter
soccïfied. All explicitly described methods should be public unless otherwise stated, and
nd you
may create additional private helper methods wherever necessary. Similarly, all instance data
should be private unless otherwise stated.
Transcribed Image Text:be putting them in one! You will set the stage for their newest adventure, a lexd-based command line adventure game, in which the gang must escape a Haunted Mansion. You will define several classes and hierarchies that take advantage of object-oriented concepts to bandle the different events and scenarios in your mansion. This will include a set of Rooms, Monsters, and a Player the arrangement, or Loorplan, of rooms. A Player always begins in the middlemost Room of the mansion. An exit toom will be specia. ly designated. "The layer can move left, right, up, or down one slep (Room) during each round of the game. The Player begins the game with a love immediately lose the game. Player enters a Room, they may encounter a Monster. Á Monster encounter will take a toll on a layer's courage. Monsters come in different varieties, and their respective effects on players ou will have a base Monster class and some subclasses to create different types of Monsters. While the scary monsters are there to thwart you, fortunately there will be Scooby Snacks in a Player's courage. The data members for your classes should be only accessible via appropriate setier and getter soccïfied. All explicitly described methods should be public unless otherwise stated, and nd you may create additional private helper methods wherever necessary. Similarly, all instance data should be private unless otherwise stated.
MansionDriver.java
This will be your driver class. You should prompt the user for input to determine:
1. A name for the Player.
2. A size for the mansion (positive whole number). If 10 is given, for example, the mansion will be
10x10.
3. The percentage of rooms which should contain monsters (out of 100). If 20 is given, for example,
20% of the rooms in the mansion will contain monsters.
4. The number of rooms which should have Scooby Snacks.
You will use this information to create your mansion's room layout. Create a 2D array of Rooms with its
dimensions determined by the given size. Then fill each spot with a new Room. For now, every room will
have no monster and not contain Scooby Snacks.
Now you can use the HauntedHelper class to help you fill in the details. Make a HauntedHelper instance
and provide its constructor with the array you have created.
You can use the selectGoal Room method to pick and store the goal room of the mansion.
Calculate the number of rooms which will have monsters based on the given percentage and size. This
many times, you should call the placeMonster method on the HauntedHelper to place a monster (it
will be one of the three possible types) in a room which does not already have one.
Similarly, for each room which should have a Scooby Snack, call the placeSnack method on the
Haunted Helper to place a snack in a room which does not already have one.
Now your mansion layout is complete! Go ahead and construct the Haunted Mansion, run your program,
and try to escape the mansion!
Transcribed Image Text:MansionDriver.java This will be your driver class. You should prompt the user for input to determine: 1. A name for the Player. 2. A size for the mansion (positive whole number). If 10 is given, for example, the mansion will be 10x10. 3. The percentage of rooms which should contain monsters (out of 100). If 20 is given, for example, 20% of the rooms in the mansion will contain monsters. 4. The number of rooms which should have Scooby Snacks. You will use this information to create your mansion's room layout. Create a 2D array of Rooms with its dimensions determined by the given size. Then fill each spot with a new Room. For now, every room will have no monster and not contain Scooby Snacks. Now you can use the HauntedHelper class to help you fill in the details. Make a HauntedHelper instance and provide its constructor with the array you have created. You can use the selectGoal Room method to pick and store the goal room of the mansion. Calculate the number of rooms which will have monsters based on the given percentage and size. This many times, you should call the placeMonster method on the HauntedHelper to place a monster (it will be one of the three possible types) in a room which does not already have one. Similarly, for each room which should have a Scooby Snack, call the placeSnack method on the Haunted Helper to place a snack in a room which does not already have one. Now your mansion layout is complete! Go ahead and construct the Haunted Mansion, run your program, and try to escape the mansion!
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 10 images

Blurred answer
Knowledge Booster
Unreferenced Objects
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education