Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Help!! Your assignment is to develop a manhunt simulator. The manhunt simulator will have two people. The investigator who will be demarked with an

C++ Help!!

Your assignment is to develop a manhunt simulator. The manhunt simulator will have two people. The investigator who will be demarked with an I and a target who will be demarked with a T. The target will not be directly visible on the map though.

The application should:

1. Have a starting menu that asks if the user wants to:

a.Load data from a text file

b.Ask the user for details of the investigator and the target. The information for each will include their starting point using an X and Y coordinate system.

2. Have a main menu that asks the user if they want to:

a.Search North

b.Search East

c.Search South

d.Search West

e.Exit

3. The four symbols on the map are: I = Investigator, T = Target, _ = Unsearched Area, and * = Searched Area.

4. You can only search in the four cardinal areas (north, south, east, west) there is no nw, ne, sw, se. It will indicate east/west first then north/south. For example, if the target is north-west of the target, it will tell the investigator to search west first. Then if the investigator is west enough, it will indicate north/south.

5. As part of the search, if the target is not found, it should indicate which direction should continue searching.

6. If the user finds the target, it should indicate that the target was found and exit the program.

7. The map will always have a width of 10 and a height of 10. (no magic numbers!). Additionally, the map must be stored in an array (it is up to you how many dimensions one or more).

8. If the user tries to exit the search area, the program should indicate that search is not allowed and re-prompt the user.

9. The program exits after the target is found.

1. Requirements:

This is a list of the requirements of this application. For this project, it is up to you exactly how you want to implement it. In order for you to earn all of the points, however, you will need to meet all of the defined requirements.

Notice the trailing period is required (it says copy it into this folder).

You must follow the coding standard as defined in the CMSC 202 coding standard (found on Blackboard under course materials). This includes comments as required.

The project must be completed in C++. You may not use any libraries or data structures that we have not learned in class. Libraries we have learned include , , , , , and . You should only use namespace std.

You must use a variety of functions including passing parameters to those functions and returning information from those functions. At least one time, an array must be passed to a function.

Each menu must be implemented with a switch statement.

All user input must be validated. For example, if a menu allows for 1, 2, or 3 to be entered and the user enters a 4, it will re-prompt the user. However, the user is expected to always enter the correct data type. i.e. If the user is asked to enter an integer, they will. If they are asked to enter a character, they will. You do not need to worry about checking for correct data types.

The name of the input file is entered by the user. The input file name is not validated at all. The input file will always be in the same folder as the project file.

2. Recommendations

You are free to implement this with your own functions. While not required, these are some functions that you may want to include:

Start Menu (including validated user input) Welcomes the user to the application and has the user choose between loading the map from a file, entering a new map, or exit. It must validate the choice to be between 1 and 3.

Main Menu (including user input) Once the map is completed or loaded, this menu allows users to search in a particular direction or exit. It must validate the choice to be between 1 and 6.

Load Map Uses file input to load in the text file. The file will always be named test1.txt. The text file will have exactly four inputs. One on each line. They are integers representing the X axis of the investigator, the Y axis of the investigator, the X axis of the target, and the Y axis of the target.

New Map Allows the user to enter the X and Y coordinates of the starting investigator and the X and Y coordinates of the target. Fills the rest with underscores.

Print Map Outputs the entire map including where the investigator currently is. Spaces that are unsearched are an underscore(_), the investigator is an I, and the target is demarked by a T but is not visible in the print map the target is hidden!

Check Search Checks the entire map to make sure that the direction that the user wants to search is legal and is not the target. *This is one of the trickier functions/sets of functions*

The board will be a constant 10 by 10. The test1.txt will be 4 numbers regarding the x and y coordinates of the target and investigator.

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

Question

=+How should it be delivered?

Answered: 1 week ago

Question

=+4 How does one acquire a global mindset?

Answered: 1 week ago