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...
Instructions: program in C++, add pseudocode and comment throughout the program. Assignment: Create a program to...
Instructions: program in C++, add pseudocode and comment throughout the program. Assignment: Create a program to keep track of the statistics for a kid’s soccer team. The program will have a structure that defines what data the program will collect for each of the players. The structure will keep the following data: Players Name (string) Players Jersey Number (integer) Points scored by Player (integer) The program will have an array of 12 players (use less for testing and development, use...
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?
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...
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...
So Bob and Terry are friends who grew up in California. There is a free ticket...
So Bob and Terry are friends who grew up in California. There is a free ticket to Coachella near Indio being offered by a radio station. Both friends call in separately and the radio station tell them that they won it. A Coachella ticket can cost anywhere from $600 for GA ( general admission) all the way to $2000 for VIP per person. Getting one of those tickets is quite expensive! So Bob and Terry both go down to the...
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT