Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Assignment: Haunted House

For this assignment, you will be building a class, creating objects, doing comparisons and using nested control statements. You need to remember what you have learned in class, lab, books and your assignments. Be sure to refer to them when you need to.

There are 2 parts to this assignment. In the first part, you are going to be given a problem and you will then need to create a structure,write algorithms and a flow chart to solve it. In the second part, you'll be turning this into a java program.

So let's get started!

Part 1: Your haunted house adventure!

Ever since you were a little kid, there has been this one house at the end of the street that is dark and scary. Everyone says that its haunted! Of course, you don't believe in those things, but it has inspired you, so you've decided to create an interactive haunted house adventure for your friends. Here's the layout of the house:

The user always starts the game at the front door and must immediately decide where they want to go. Your movement constraints are as follows:

• From the front door, the user must choose between going into the livingroom, dining room or up the stairs.

• To get from one room to the next, there must be a door. That means that to get to some rooms, the user must go through other rooms. See the above diagram for more details.

• If the user is in a room that is attached to another room via a door (not the one they just came in-no backtracking! ), the user must be given the option between going to the other room or exploring an item in the current room.

• If the user is in a room that has no other exit, then they must be given the option between exploring the items in the room.

Program Flow:

• Ask the user to enter their name so that you can personalize their experience. You will want to use their name as they move through the house and make decisions

• Start at the front door as described above.

• Each time the user moves to a new room, you must then ask the user what he or she wants to do next. The options available are derived above. Note that there are sometimes more that 2 options available.

• Should the user reach a room where there is no other exit, they must select an object to explore.

• Once the object is explored, the game is over. This should be indicated clearly to the user (and have fun!).

Input/Output Requirements:

• As stated above, you must ask the user for his or her name.

• Welcome the user to the game. Be sure to include their name in your welcome message.

• Using ascii art or graphics, print out an image showing where in the house the user is starting.

• For each step, present the users with their options and ask them what they want to do (hint: put word options in quotes to indicate what they should type in to respond to your question)

• Once they have selected an object to explore, be sure to print out their final outcome.

• At the end of the game, using ascii art or graphics, print out an image showing where in the house the user ended the game.

Program Structure Requirements:

• For your class structure, you must use classes, objects and methods.

• Do NOT just use a huge series of sequential if statements, nested if statements or switch statements for your program flow

Program Structure Requirements:

• For your class structure, you must use classes, objects and methods.

• Do NOT just use a huge series of sequential if statements, nested if statements or switch statements for your program flow

For Part 1, create a class structure,algorithmsand flow chartfor yourprogram, and then do several iterations of tests (i.e., analyze it and step through to make sure that it is logically correct). Also write the pseudocode for your testerclass (where your main will go). Put these in a Word or Open Office document. You'll turn that document in with the program that you create in Part 2.

Part 2: Creating your Haunted House program

Once you are done writing and testing your class structure and algorithm, you are ready to start coding!

1. Once again, you first you need to create a project. Here's a nice tutorial on how to do that in Netbeans. If you are using Dr. Java or Eclipse, just do a quick search on youtube.com and you'll find lots of candidates.

Youtube Video: "Making a Simple GUI App with NetBeans"

Be sure to give your project a nice, meaningful name (and make sure it adheres to Java's naming conventions).

2. Once you have your shell ready, there are a few things to know before you start translating your algorithm into code

• At the top of your class file, be sure to include the following:

//********************************************************************************
// PANTHERID: [PantherID]
// CLASS: COP 2210 - [Semester Year]
// ASSIGNMENT # [#]
// DATE: [Date]
//
// I hereby swear and affirm that this work is solely my own, and not the work
// or the derivative of the work of someone else.
//********************************************************************************

3. Now start translating your algorithm into java code.

• Remember to code and then compile frequently. It will make it easier to find any bugs.
• Also remember that you will need to create a testerclass (where your main method will reside).

4. Once you get your program running correctly, run through 3 scenarios (we will, of course, be testing your other scenarios, but use these for your output):

• Finish in the Living Room
• Finish in the Master Bathroom (choose either option)
• Finish in the Pantry (choose either option)

5. Here is one more thing to do. Any input requested from the user and/or output received from the user should be in a window (see E.1.14 and E.1.15 from lab 1). At this point, you probably have your output going to the console. For your final submission, it needs to go to a window (JOptionPane). Don't forget any additional libraries that you need to import to do this.

That's it! Now you have written your first adventure game! Of course, you'll also need to turn it in to Moodle.

Submission Requirements

You must upload a zip file to Moodle that includes your complete source project in Netbeans, ready to load (We have been very lenient up until now regarding this. From this assignment on, you will lose points if you do not include your complete project.), and also contains the output in separate data files, and your Word/Open Office document with your algorithm.

VERY IMPORTANT: If you do not provide output in separate, easy to find data files, I will assume that your program does not work on those test cases, and grade accordingly. Do not embed the output in your source code.

Attachment:- Assignment.rar

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M92760836

Have any Question?


Related Questions in Programming Language

1 write a function named check that has three parameters

1. Write a function named check () that has three parameters. The first parameter should accept an integer number, andthe second and third parameters should accept a double-precision number. The function body should just ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Overviewthis tasks provides you an opportunity to get

Overview This tasks provides you an opportunity to get feedback on your Learning Summary Report. The Learning Summary Report outlines how the work you have completed demonstrates that you have met all of the unit's learn ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Background informationthis assignment tests your

Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fun ...

Php amp session managment assignment -this assignment looks

PHP & SESSION MANAGMENT ASSIGNMENT - This assignment looks at using PHP for creating cookies and session management. Class Exercise - Web Project: Member Registration/Login This exercise will cover adding data connectivi ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Task working with arraysoverviewin this task you will

Task: Working with Arrays Overview In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, w ...

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As