Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Start with a blank console application in ( c# ). a. Add a class named Monster that has the following attributes: string name. Feel

1. Start with a blank console application in ( c# ).

a. Add a class named Monster that has the following attributes: string name. Feel free to make your monster have other attributes, but they are not required. [5 Points]

b. Create a constructor that accepts the name via parameters to create a new monster. [5 Points]

c. Create a property for the name field and use it to access the fields. [5 Points]

d. Create an empty 1D array that is 13 slots big. Randomly place 3 monsters in the 1D array. These will be hidden to your player, but you may want to output the locations somewhere for yourself during testing and coding. The remainder of the positions should be empty. [5 Points]

e. Create an empty 1D array that will hold three monsters that you will capture. [5 Points]

f. Write a method that outputs a structure to the console that simulates the array to the console. At the beginning of the game, your playing field will look similar to this: [20 Points]

1 2 3 ...

g. Write a method that asks the user select a square using the numbering from your display. Determine if there is monster in that cell or not and give your user appropriate feedback. This method should be called repeatedly from main until the game is done. If the user selects a square that doesn't contain a monster, give feedback to your player - "hot" means there is a monster in an adjacent cell, "cold" means there is not. If the user selects a square that contains a monster, that monster is considered captured and should be moved to the 1D array that represents the monster jail. [25 Points]

h. Give your user feedback in the grid output so that they know when a square has already been chosen. Also give your user feedback regarding captured monsters. You can modify your method from 7 to handle this. For example, if the user chose 2, the new grid would look like this: [15 Points] Playing Field

[ 1 ] [ X ] [ 3 ] [ ... ]

Captured Monsters

[ orc ] [ ... ] [ ... ]

i. Create a mechanism that tracks how many guesses it took to capture all of the monsters. If youd like, make your game so that a user has a limited number of guesses. [10 points]

j. Game is over when all three monsters are collected.

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

More Books

Students also viewed these Databases questions