Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Name: Noah Singer
- Date: 09/12/2019
- Section: 0019
- Assignment: Zombie Apocalypse Assignment 3
- Due Date: 09/15/2019
- 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.
- Assumptions: assumes correct user input
- All work below was performed by Noah Singer */
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main() {
- char ALREADY_BITTEN, // User decisions to be inputted In terms of Y and N
- SCARED,
- WEAPON,
- RUN,
- FIGHT;
- std::cout << "Welcome to the Zombie Apocalypse RPG!\n"; // Welcome message
- std::cout << "are you already bitten by a zombie? (Y/N) ";
- std::cin >> ALREADY_BITTEN;
- {
- if (ALREADY_BITTEN == 'Y' || ALREADY_BITTEN == 'y')
- std::cout << "Go to a populated area where you have access to human brains!";
- else if (ALREADY_BITTEN == 'N' || ALREADY_BITTEN == 'n')
- {
- std::cout << "Are you scared of zombies? ";
- std::cin >> SCARED;
- }
- else
- std::cout <<"You have entered invalid data. Please run the program again! ";
- }
- {
- if (SCARED == 'Y' || SCARED == 'y')
- {
- std::cout << "Do you know how to use a weapon? ";
- std::cin >> WEAPON;
- }
- else if (SCARED == 'N' || SCARED == 'n')
- {
- std::cout << "Do you think you can fight off a zombie on your own? ";
- std::cin >> FIGHT;
- }
- else
- std::cout << "You have entered invalid data. Please run the program again! ";
- }
- {
- if (FIGHT == 'Y' || FIGHT == 'y')
- std::cout << "Try to move to a safer place even though you can defend yourself!";
- else if (FIGHT == 'N' || FIGHT == 'n')
- std::cout << "Find someone who can protect you!";
- else
- std::cout << "You have entered invalid data. Please run the program again! ";
- }
- {
- if (WEAPON == 'Y' || WEAPON == 'y')
- std::cout << "Try to move to a safer place even though you can defend yourself!";
- else if (WEAPON == 'N' || WEAPON == 'n')
- {
- std::cout << "Could you at least run? ";
- std::cin >> RUN;
- }
- else
- std::cout << "You have entered invalid data. Please run the program again! ";
- }
- {
- if (RUN == 'Y' || RUN == 'y')
- std::cout << "Run to a safer place away from the zombies!";
- else if (RUN == 'N' || RUN == 'n')
- std::cout << "Oh boy!";
- else
- std::cout << "You have entered invalid data. Please run the program again! ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement