Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a java program. There are 2 parts to this assignment. In the first part, you are going to be given a problem and you

Write a java program. 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, youll be turning this into a java program.

So lets get started!

Part 1: Your Easter Bunny Egg Hunt!

Ever since you were a little kid, one of your favorite times of the year has been the Spring when there are egg hunts and the Easter Bunny brings you lots candy and treats. You no longer believe in the Easter Bunny, but it has inspired you, so youve decided to create an interactive Easter Bunny egg hunt for your friends. Heres the layout of the park: image text in transcribed

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

From the Park Entrance, the user must choose between going into the Spring Meadow, Garden Gate or Aeryns Overlook.

To get from one area to the next, there must be a path. No going through the bushes! That means that to get to some areas, the user must go through other areas. See the above diagram for more details.

If the user is in an area that is attached to another area via a path (not the one they just came inno backtracking!), the user must be given the option between going to the other area or searching an item in the area.

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

Here are the possible outcomes for exploring items in each area:[}

You may, if you wish, add to the number of items available in an area, and/or change the outcome of exploring specific items. However, you cannot decrease the number of options in an area. image text in transcribed You may, if you wish, add to the number of items available in an area, and/or change the outcome of exploring specific items. However, you cannot decrease the number of options in an area.

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 park and make decisions

Start at the entrance as described above.

Each time the user moves to a new area, 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 or more options available.

Should the user reach an area where there is no other exit, they must select an item to explore.

The game is over once an item is explored. 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 park the user is starting (this part and the end only can be in the console instead of jOptionPane).

For each step, present the users with their options and ask them what they want to do (hint: use buttons[1] OR 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 park the user ended the game.

For Part 1, create a class structure, algorithms and flow chart for your program, 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 tester class (where your main will go). Put these in a Word or Open Office document.

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 tester class (where your main method will reside).

Part 2: Creating your Easter Bunny Egg Hunt program

2. 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 Spring Meadow

Finish in the ButterFly Garden

Finish in Ravens Tower

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 At this point, you probably have your output going to the console. For your final submission, it needs to go to a window (JOptionPane). Dont forget any additional libraries that you need to import to do this.

Park Entrance Spring Meadow Reading Nook Raven Tower Aeryn s Overlook Peaceful Pond Main Park Festive Falls D (D Flowering Forest Butterfly Rose Garden Garden Bunny Bridge Gardens Park Entrance Spring Meadow Reading Nook Raven Tower Aeryn s Overlook Peaceful Pond Main Park Festive Falls D (D Flowering Forest Butterfly Rose Garden Garden Bunny Bridge Gardens

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

Students also viewed these Databases questions