assign 3 directions

Upload: cameron-pereira

Post on 07-Jul-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/18/2019 Assign 3 Directions

    1/6

    Assignment 3: Haunted House

    For this assignment, you will be building a class, creating objects, doingcomparisons and using nested control statements. You need to

    remember what you have learned in class, lab, books and yourassignments. e sure to re!er to them when you need to.

     "here are # parts to this assignment. $n the %rst part, you are going tobe given a problem and you will then need to create a structure, writealgorithms and a &ow chart to solve it. $n the second part, you'll beturning this into a java program.

    (o let's get started)

    Part 1: Your haunted house adventure!

    *ver since you were a little kid, there has been this one house at theend o! the street that is dark and scary. *veryone says that itshaunted) +! course, you don't believe in those things, but it hasinspired you, so you've decided to create an interactive haunted houseadventure !or your !riends. Here's the layout o! the house:

  • 8/18/2019 Assign 3 Directions

    2/6

       ,  a  s  t  e  r    e  d  r  o  o   m (       

    t        a     

    i       r      s     

        e  d  r  o  o   m  -

        e  d  r  o  o   m  #

        a  t  h  r  o  o   m

       ,  a  s  t  e  r    a  t  h  r  o  o   m

      . i  v i  n  g   /  o  o   m

     (       t       

     a     i       r     

     s     

       0 i  n i  n  g   /  o  o   m   1 i  t  c  h  e  n

      2  a  n  t  r  y     a  t  h  r  o  o   m

    Front 0oor

  • 8/18/2019 Assign 3 Directions

    3/6

     "he user always starts the game at the front door  and mustimmediately decide where they want to go. Your movementconstraints are as !ollows:

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

    •  "o get !rom one room to the net, there must be a door . "hatmeans that to get to some rooms, the user must go throughother rooms. (ee the above diagram !or more details.

    • $! the user is in a room that is attached to another room via adoor 4not the one they just came in—no backtracking!i5, theuser must be given the option between going to the other roomor eploring an ITEM in the current room.

    • $! the user is in a room that has no other eit, then they must be

    given the option between exploring the items in the room.

    Here are the possible outcomes !or eploring items in each room:ii

    Floor /oom Item(s +utcome- iving "oom 6hest 7host escapes and scares you to

    death- #ining

    "oom6andelabra

    ight up by themselves and seea death shadow

    - $itchen /e!rigerator

    +pen it and %nd some delicioussoul !ood

    - $itchen 6abinet "he dishes and glasses start&ying at you as soon as you openthe door. You get hit in the headand !eel yoursel! start movingtowards a light

    - Pantry 0ustyrecipe bo

     You open it up and a recipe !orchocolate devils !ood cakeappears our o! no where

    - Pantry room Flies up in the air as soon as youtouch it

    - %athroom irror (ee a bloody !ace looking back

    at you- %athroom (hower /oom suddenly steams up and

    you !eel %ngers touching theback o! your neck

    i $! you want a challenge, you may include the ability to backtrack.ii You may, i! you wish, add to the number o! items available in a room,and8or change the outcome o! eploring speci%c items. However, youcannot decrease the number o! options in a room.

    9p (tairs 4#nd Floor50own (tairs 4-st 

  • 8/18/2019 Assign 3 Directions

    4/6

    # %edroom 1 /ocking6hair

    6hair starts rocking by itsel! withno one in it

    # %edroom 1 indow (ee a child outside on a swingwho suddenly disappears

    # %edroom & 0oll House "he dolls start dancing on their

    own# %edroom & 0resser A ghost &ies out o! the dresser as

    soon as you open it and goesright though your body

    # Master%edroom

     ;ewelryo

     You %nd the cursed Hope0iamond and !eel your doom

    # Master%athroom

    $ntricate+il amp

    /ub the lamp and a genie popsout who says he'll grant you 3wishes

    # Master%athroom

    (hower (uddenly hear singing in theshower, but no one is there

    # %athroom irror (ee a bloody !ace looking backat you

    # %athroom (hower /oom suddenly steams up andyou !eel %ngers touching theback o! your neck

    Program 'o):

    • etheir eperience. You will want to use their name as they move

    through the house and make decisions• (tart at the !ront door as described above.

    •  *ach time the user moves to a new room,

  • 8/18/2019 Assign 3 Directions

    5/6

  • 8/18/2019 Assign 3 Directions

    6/6

    8888 $ hereby swear and arm that this work is solely my own, and notthe work88 or the derivative o! the work o! someone else.88EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

    EEEEEEEEEE

    3. Bow start translating your algorithm into java code.

    • /emember to code and then compile !re@uently. $t will make it

    easier to %nd any bugs.

    • Also remember that you will need to create a tester cass 

    4where your main method will reside5.

    ?. +nce you get your program running correctly, run through 3scenarios 4we will, o! course, be testing your other scenarios, butuse these !or your output5:

    • Finish in the iving /oom• Finish in the aster athroom 4choose either option5

    • Finish in the 2antry 4choose either option5

    I. Here is one more thing to do. Any input reueste! rom the useran!"or output receive! rom the user shoul! be in a win!ow 4see*.-.-? and *.-.-I !rom lab -5. At this point, you probably have youroutput going to the console. For your %nal submission, it needs togo to a window 4;+ption2ane5. 0on't !orget any additional librariesthat you need to import to do this.

     "hat's it) Now you have written your #rst a!venture game) +! course,you'll also need to turn it in to oodle.

    5ubmission "e-uirements You must upload a >ip %le to oodle that includes your com*etesource *roject in 8etbeans/ ready to oad (e have been verylenient up until now regarding this. From this assignment on, you willlose points i you !o not inclu!e your complete pro$ect .5, and alsocontains the output in separate data %les, and your ord8+pen +cedocument with your algorithm.

    9E"Y IMP,"T.8T: $! you do not provide output in separate, easy to%nd data %les, $ will assume that your program does not work on thosetest cases, and grade accordingly. %o not embe! the output in yoursource co!e.