Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.65 KB | None | 0 0
  1. # Heist Part II
  2.  
  3. - Knocking over banks isn't going to be easy. Alarms... Vaults... Security Guards.... Each of these safeguards is something we'll have to handle for a successful heist. First things first. Let's create a `Bank` class to represent the security we're up against. Give the `Bank` class the following properties:
  4. - An integer property for `CashOnHand`
  5. - An integer property for `AlarmScore`
  6. - An integer property for `VaultScore`
  7. - An integer property for `SecurityGuardScore`
  8. - A _computed_ boolean property called `IsSecure`. If _all_ the scores are less than or equal to 0, this should be `false`. If _any_ of the scores are above 0, this should be `true`
  9.  
  10. - Each type of robber will have a special skill that will come in handy while knocking over banks. Start by creating an interface called `IRobber`. The interface should include:
  11. - A string property for `Name`
  12. - An integer property for `SkillLevel`
  13. - An integer property for `PercentageCut`
  14. - A method called `PerformSkill` that takes in a `Bank` parameter and doesn't return anything.
  15.  
  16. - Since bank security consists of alarms, vaults, and security guards; we'll need crew members that can deal with each of them. We'll need **hackers** to take care of the alarms; **lock pick specialists** to crack the vaults, and some good old fashion **muscle** to handle the security guards. Create three classes: `Hacker`, `Muscle`, and `LockSpecialist`. They should all implement the `IRobber` interface. Each implementation for `PerformSkill` should do three things:
  17. - Take the `Bank` parameter and decrement its appropraite security score by the `SkillLevel`. i.e. A Hacker with a skill level of 50 should decrement the bank's `AlarmScore` by 50.
  18. - Print to the console the name of the robber and what action they are performing. i.e. _"Mr. Pink is hacking the alarm system. Decreased security 50 points"_
  19. - If the appropriate security score has be reduced to 0 or below, print a message to the console, i.e. _"Mr Pink has disabled the alarm system!"_
  20.  
  21. Before we start trying to assemble the perfect crew, we need to know who our options are. Let's build out a rolodex of possible recruits first. We'll pick the team and plan out the actual opperation later.
  22.  
  23. - In the `Main` method, create a `List<IRobber>` and store it in a variable named `rolodex`. This list will contain all possible operatives that we could employ for future heists. We want to give the user the opportunity to add new operatives to this list, but for now let's pre-populate the list with 5 or 6 robbers (give it a mix of Hackers, Lock Specialists, and Muscle).
  24.  
  25. - When the program starts, print out the number of current operatives in the roladex. Then prompt the user to enter the name of a new possible crew member. Once the user has entered a name, print out a list of possible specialties and have the user select which specialty this operative has. The list should contain the following options
  26. - Hacker (Disables alarms)
  27. - Muscle (Disarms guards)
  28. - Lock Specialist (cracks vault)
  29.  
  30. Once the user has selected a specialty, prompt them to enter the crew member's skill level as an integer between 1 and 100. Then prompt the user to enter the percentage cut the crew member demands for each mission. Once the user has entered the crew member's name, specialty, skill level, and cut, you should instantiate the appropriate class for that crew member (based on their specialty) and they should be added to the rolodex.
  31.  
  32. - Continue the above action and allow the user to enter as many crew members as they like to the rolodex until they enter a blank name before continuing.
  33.  
  34. Once the user is finished with their rolodex, it's time to begin a new heist
  35.  
  36. - The program should create a new bank object and randomly assign values for these properties:
  37. - AlarmScore (between 0 and 100)
  38. - VaultScore (between 0 and 100)
  39. - SecurityGuardScore (between 0 and 100)
  40. - CashOnHand (between 50,000 and 1 million)
  41.  
  42. Let's do a little recon next. Print out a Recon Report to the user. This should tell the user what the bank's _most_ secure system is, and what its _least_ secure system is (don't print the actual integer scores--just the name, i.e. `Most Secure: Alarm` `Least Secure: Vault`
  43.  
  44. Now that we have a clue what kind of security we're working with, we can try to built out the perfect crew.
  45.  
  46. - Print out a report of the rolodex that includes each person's name, specialty, skill level, and cut. Include an index in the report for each operative so that the user can select them by that index in the next step. (You may want to update the IRobber interface and/or the implementing classes to be able to print out the specialty)
  47.  
  48. - Create a new `List<IRobber>` and store it in a variable called `crew`. Prompt the user to enter the index of the operative they'd like to include in the heist. Once the user selects an operative, add them to the `crew` list.
  49.  
  50. - Allow the user to select as many crew members as they'd like from the rolodex. Continue to print out the report after each crew member is selected, but the report should not include operatives that have already been added to the crew, or operatives that require a percentage cut that can't be offered.
  51.  
  52. - Once the user enters a blank value for a crew member, we're ready to begin the heist. Each crew member should perform his/her skill on the bank. Afterwards, evaluate if the bank is secure. If not, the heist was a success! Print out a success message to the user. If the bank _does_ still have positive values for any of its security properties, the heist was a failure. Print out a failure message to the user.
  53.  
  54. - If the heist was a success, print out a report of each members' take, along with how much money is left for yourself.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement