Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. /* Name: Noah Singer
  2. Date: 09/12/2019
  3. Section: 0019
  4. Assignment: Zombie Apocalypse Assignment 3
  5. Due Date: 09/15/2019
  6. About this project: The Project asks the user questions from the How to survive a Zombie Apocalypse flow chart and displays the appropriate message to the user.
  7. Assumptions: assumes correct user input
  8. All work below was performed by Noah Singer */
  9.  
  10. #include <iostream>
  11. #include <iomanip>
  12.  
  13. using namespace std;
  14.  
  15. int main() {
  16.  
  17. char ALREADY_BITTEN, // User decisions to be inputted In terms of Y and N
  18. SCARED,
  19. WEAPON,
  20. RUN,
  21. FIGHT;
  22.  
  23. std::cout << "Welcome to the Zombie Apocalypse RPG!\n"; // Welcome message
  24.  
  25. std::cout << "are you already bitten by a zombie? (Y/N) ";
  26. std::cin >> ALREADY_BITTEN;
  27.  
  28. {
  29. if (ALREADY_BITTEN == 'Y' || ALREADY_BITTEN == 'y')
  30. std::cout << "Go to a populated area where you have access to human brains!";
  31. else if (ALREADY_BITTEN == 'N' || ALREADY_BITTEN == 'n')
  32. {
  33. std::cout << "Are you scared of zombies? ";
  34. std::cin >> SCARED;
  35. }
  36. else
  37. std::cout <<"You have entered invalid data. Please run the program again! ";
  38. }
  39.  
  40. {
  41. if (SCARED == 'Y' || SCARED == 'y')
  42. {
  43. std::cout << "Do you know how to use a weapon? ";
  44. std::cin >> WEAPON;
  45. }
  46. else if (SCARED == 'N' || SCARED == 'n')
  47. {
  48. std::cout << "Do you think you can fight off a zombie on your own? ";
  49. std::cin >> FIGHT;
  50. }
  51. else
  52. std::cout << "You have entered invalid data. Please run the program again! ";
  53. }
  54.  
  55. {
  56. if (FIGHT == 'Y' || FIGHT == 'y')
  57. std::cout << "Try to move to a safer place even though you can defend yourself!";
  58. else if (FIGHT == 'N' || FIGHT == 'n')
  59. std::cout << "Find someone who can protect you!";
  60. else
  61. std::cout << "You have entered invalid data. Please run the program again! ";
  62. }
  63.  
  64. {
  65. if (WEAPON == 'Y' || WEAPON == 'y')
  66. std::cout << "Try to move to a safer place even though you can defend yourself!";
  67. else if (WEAPON == 'N' || WEAPON == 'n')
  68. {
  69. std::cout << "Could you at least run? ";
  70. std::cin >> RUN;
  71. }
  72. else
  73. std::cout << "You have entered invalid data. Please run the program again! ";
  74. }
  75.  
  76. {
  77. if (RUN == 'Y' || RUN == 'y')
  78. std::cout << "Run to a safer place away from the zombies!";
  79. else if (RUN == 'N' || RUN == 'n')
  80. std::cout << "Oh boy!";
  81. else
  82. std::cout << "You have entered invalid data. Please run the program again! ";
  83. }
  84.  
  85.  
  86.  
  87.  
  88. return 0;
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement