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!
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
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 10 images
Knowledge Booster
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.Recommended textbooks for you
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education