Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please create a java program , UML diagram and document the java code of the following question: You are a spy for our government that

Please create a java program , UML diagram and document the java code of the following question:

You are a spy for our government that has been working undercover trying to discover the secret headquarters of our enemy adversary. After years of earning the enemy's trust by joining their ranks as one of them you have finally been invited to their home base. Unfortunately your true identity has been discovered and the enemy agents are searching their headquarters for you. You managed to get a transmission out to our government but help will not arrive for 30 moves. In the meantime, you find yourself moving from room to room avoiding the THREE enemy agents looking for you. You have an advantage that your "super spy" glasses you are wearing can see through walls so you know the whereabouts of all the enemies (they don't know which room you are in). However, FIVE room doors (chosen at random) are locked so you can't enter through that door (you don't know which doors are locked until you try to enter). The enemy agents have a key so they can freely pass through these locked doors.

You are armed, and will have to use your weapon if you enter a room that has any enemy agents (or an enemy agent enters a room you are in). If you kill an enemy agent, you will get their keys allowing you to unlock any locked door you encounter. The game ends if you kill all three enemy agents, or if you are killed by them, or you manage to stay alive for 30 moves.

The Design Details:

1. There is a definite floorplan for the enemy headquarters. Click here to get the floorplan diagram that you will somehow need to program into your simulation.

2. YOU start the simulation in room 0 - MAIN ENTRANCE.

3. There are THREE enemy agents randomly placed somewhere in the headquarters. More than one enemy agent can be in the same room.

4. You alternate turns. First you select a room you can move to based on the room you're currently in. For example, from the floorplan if you are in room 0 you can move to either room 1,2,3, or 4 (assuming the room door is not locked).

5. After your move, the enemy agents randomly move to another room from their current location.

6. If either you enter a room that has one or more enemy agents OR an enemy agent moves into a room where you are then you begin shooting at each other. The shooting sequence works like this. The enemy agent picks a random number between 0 and 3. YOU then pick a random number between 0 and 3. If your number picked matches the enemy's randomly chosen number then you have SHOT the enemy agent AND you gain the enemy's door keys allowing you to pass through locked doors.However, if it doesn't match then it's a "miss" and the enemy agent can shoot at you. The enemy agent picks a random number between 0 and 3. If the random number is zero(0) then the enemy agent has shot YOU and you're dead. Otherwise its a "miss" as well. You alternate firing at each other until either YOU or the ENEMY is dead.

7.Game is over when you're dead, all three enemy agents are dead or you survive 30 moves.

UML DIAGRAM - Liberal use of classes. Proper associations and inheritance relationships. Diagram accurately describes the actual code.

PROGRAMMING

- ENEMY HEADQUARTERS floor plan corrrectly represented in code and YOU can correctly move from room to room.

- RANDOMLY LOCKED DOORS correctly prevents YOU from entering a room unless you have the key.

- ENEMY AGENTS correctly moving from room to room including "not moving" if shot DEAD.

- FIGHT scenario coded correctly between YOU and ENEMY agents including obtaining the door key.

- 'Style' of code. Object oriented design (good use of classes/objects), easy to read (white space, indentation).

DOCUMENTED CODE - Full verbose documentation: classes, attributes, and methods.

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

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

What is the relation of physical mathematics with examples?

Answered: 1 week ago

Question

What are oxidation and reduction reactions? Explain with examples

Answered: 1 week ago