Question

In: Computer Science

PLEASE CREATE A PROGRAM IN PSEUDOCODE AND C# Back in my Day!  Kids who grew up in...

PLEASE CREATE A PROGRAM IN PSEUDOCODE AND C#

Back in my Day!  Kids who grew up in the late 70s didn’t have a lot of options for video games, but they did have “Choose your own Adventure” books.  These books were cool and let the reader make meaningful decisions.  If they chose choice “A”, they would turn to a page of the book and continue their adventure.  If they chose choice “B”, they would turn to a different page and read a different adventure.  Your task is to design (pseudocode) and implement (source code) for a story that has four different outcomes based on two different user inputs.  See appendix for checking string equality.

Sample run 1:

It is a dark and stormy night.  Do you want to take an umbrella?  (Y/N): Y

Good - you have an umbrella.

You start to walk down a path and hear a scream.  You realize that the person screaming is YOU because you see a wolf! Do you fight with your umbrella or run? ((F)ight/(R)un): F

You take out your umbrella and jab it into the wolf's paw!  It runs away and you live another day.

Sample run 2:

It is a dark and stormy night.  Do you want to take an umbrella?  (Y/N): Y

Good - you have an umbrella.

You start to walk down a path and hear a scream.  You realize that the person screaming is YOU because you see a wolf! Do you fight with your umbrella or run? ((F)ight/(R)un): R

You begin running so fast, the umbrella opens and you fly away like Mary Poppins.  You're a little embarrassed, but you see the wolf fading off in the distance.

Sample run 3:

It is a dark and stormy night.  Do you want to take an umbrella?  (Y/N): N

You decide not to take an umbrella.

You start to walk down a path and hear a scream.  You realize that the person screaming is YOU because you see a wolf! Do you fight with your hands or run? ((F)ight/(R)un): F

You begin fighting the wolf only to realize you had just eaten a McGrease® meal earlier.  You fall dead from rigorous exercise, having had a heart attack.

Sample run 4:

It is a dark and stormy night.  Do you want to take an umbrella?  (Y/N): N

You decide not to take an umbrella.

You start to walk down a path and hear a scream.  You realize that the person screaming is YOU because you see a wolf! Do you fight with your hands or run? ((F)ight/(R)un): R

Are you serious? You can't outrun a wolf!  The wolf catches you and you are somewhat relieved because you don't have to worry about that Calculus exam…

Solutions

Expert Solution

Thanks for the question. Here is the code for the 3 scenarios. There should be another scenario when the user choose not to take the umbrella and decided to run. This scenario is missing.

Let me know for any help in comments !!

thanks a lot : )

=================================================================

#include<iostream>
#include<string>
using std::cout;
using std::cin;
using std::endl;
using std::string;


int main(){
  
  
string choice;
cout<<"It is dark and stormy night. Do you want to take an umbrella? (Y/N): ";
cin>>choice;
if(choice.compare("N")==0){
    cout<<"You decide not to take an umbrella.\n";
}else{
    cout<<"Good - you have an umbrella.\n";
}
  
string fight;
cout<<"You start to walk down a path and hear a scream. You realize that the person"
<<endl<<"screaming is YOU because you see a wolf! Do you fight with your umbrella or"
<<endl<<" run? (F)ight/(R)un): ";
cin>>fight;
  
if(choice.compare("Y")==0 && fight.compare("F")==0){
cout<<endl
<<"You take out your umbrella and jab it into the wolf\'s paw! It runs"
<<"away and you live another day"<<endl;
}else if(choice.compare("Y")==0 && fight.compare("R")==0){
  
cout<<endl
<<"You begin running so fast, the umbrella opens and you fly away like Mary"
<<endl<<"Poppins. You\'re a little embarassed, but you see the wolf fading off in the"
<<endl<<"in the distance."<<endl;
}else if(choice.compare("N")==0 && fight.compare("F")==0){
   
cout<<endl
<<"You begin fighting the wolf only to realize you had just eaten a McGrease meal"
<<endl<<"earlier. You fall dead from rigorous exercise, having had a heart attack."<<endl;
}else{

cout<<"Are you serious? You can't outrun a wolf! The wolf catches you and you are somewhat relieved\nbecause you don't have to worry about that Calculus exam"<<endl;

}
}

=======================================================================


Related Solutions

PLEASE DO THIS IN C#: Back in my Day! Kids who grew up in the late...
PLEASE DO THIS IN C#: Back in my Day! Kids who grew up in the late 70s didn’t have a lot of options for video games, but they did have “Choose your own Adventure” books. These books were cool and let the reader make meaningful decisions. If they chose choice “A”, they would turn to a page of the book and continue their adventure. If they chose choice “B”, they would turn to a different page and read a different...
write pseudocode for the following problems not c code Pseudocode only Write a C program to...
write pseudocode for the following problems not c code Pseudocode only Write a C program to print all natural numbers from 1 to n. - using while loop Write a C program to print all natural numbers in reverse (from n to 1). - using while loop Write a C program to print all alphabets from a to z. - using while loop Write a C program to print all even numbers between 1 to 100. - using while loop...
C Program and pseudocode for this problem. Write a C program that plays the game of...
C Program and pseudocode for this problem. Write a C program that plays the game of "Guess the number" as the following: Your program choose the number to be guessed by selecting an integer at random in the rang of 1 to 1000. The program then asks the use to guess the number. If the player's guess is incorrect, your program should loop until the player finally gets the number right. Your program keeps telling the player "Too High" or...
*******IN PSEUDOCODE AND C++******* Program 0 (Warm-up, 40 pts): Deoxyribonucleic acid, or DNA, is comprised of...
*******IN PSEUDOCODE AND C++******* Program 0 (Warm-up, 40 pts): Deoxyribonucleic acid, or DNA, is comprised of four bases: (G)uanine, (C)ytosine, (A)denine and (T)hymine. Ribonucleic acid, or RNA, is different than DNA in that it contains no Thymine; thymine is replaced with something called (U)racil. For this assignment, you will create an array of 255 characters. You must start by filling the array with random characters of G, C, A and T.   You must then print out the array. Next, replace...
The home where I grew up was purchased by my father for $3,200 in the year...
The home where I grew up was purchased by my father for $3,200 in the year 1943. As of the year 2012, its market value was $850,000. Using the concepts of purchasing power, inflation, and price indexes how would you explain this tremendous increase in value? Are there any other possible outside factors besides the above which might also help explain the increase?
Create a C # program that calculates what a worker must be paid if each day...
Create a C # program that calculates what a worker must be paid if each day I work different hours during the week. The price per hour is 80.0.
C++ program: Create a Date class that contains three members: the month, the day of the...
C++ program: Create a Date class that contains three members: the month, the day of the month, and the year, all of type int. The user should enter a date in the format 12/31/2001, store it in an object of type Date, then retrieve the object and print it out in the same format. Next create an employee class. The member data should comprise an employee number (type int) and the employee’s compensation (in dollars; type float). Extend the employee...
PSEUDOCODE: 1. You are designing software for a voting booth. Please create pseudocode for a modular...
PSEUDOCODE: 1. You are designing software for a voting booth. Please create pseudocode for a modular program that: - Takes in a user inputted integer for age. If their age is below 18, display "you are too young to vote" - Only If their age is high enough, please ask them which candidate they wish to vote for. Valid options are "dog", "cat", "horse" - If they did not choose a valid option display "you did not choose a valid...
(I AM IN A INTRO TO PROGRAMMING, PLEASE USE SIMPLE PSEUDOCODE IF POSSIBLE) Create pseudocode for...
(I AM IN A INTRO TO PROGRAMMING, PLEASE USE SIMPLE PSEUDOCODE IF POSSIBLE) Create pseudocode for a program for Hansel's Housecleaning Service. The program prompts the user for a customer's last name only. While the last name is not “zzz” your program will ask for the number of bathrooms and the number of other rooms to be cleaned and display the cleaning charge. You should use a sentinel-controlled while loop in your main loop logic. A customer name of “zzz”...
Create a C program that performs the following (please comment the codes): a) Create a Stack...
Create a C program that performs the following (please comment the codes): a) Create a Stack ADT. Stack should be implemented using the linked list. b) Enter 10 random integer numbers between 0 to 50 in the stack. c) After pushing each element, print the content of the top of the stack. c) Then pop out those 10 integer numbers and print those numbers. d) Finally destroy the Stack.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT