Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create an application that allows the user to explore a haunted house. Specifically, the user should be presented options of what room they'd like to

Create an application that allows the user to explore a haunted house. Specifically, the user should be presented options of what room they'd like to explore, and on selecting that room, the program should provide the user with a spooky description of that room.
Exploring a room should take the user 1 "hour" (just a count, not a real world hour). Keep a total of how many hours the user has been in the house.
When the user starts the program, they should be given four options: three options should take them to a room, and the fourth option allows them to leave the house and end the application. When the user decides to leave, tell them how many hours they've spent in the house.
Tips:
Use a while loop to keep the user in the house as long as they want to be there
Inside that loop, ask the user what room they'd like to visit.
Use if statements based on user input to describe different rooms to the user
Example:
"Welcome to the house. Enter 1 to go to the kitchen, 2 to go to the bedroom, and 3 to go to the living room. Enter 0 to quit."
2
"Oh, it's such a spooky bedroom. Oh man, you would not believe how spooky this is. For real, super spooky."
"Enter 1 to go to the kitchen, 2 to go to the bedroom, and 3 to go to the living room. Enter 0 to quit."
0
"Goodbye! You spent 1 hour(s) in the house

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions

Question

Understand the importance of strategic HR planning.

Answered: 1 week ago