Question

I need help with this in C# and also the Pseudocode. Program 1: Back in my...

I need help with this in C# and also the Pseudocode.

Program 1: 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 umbrella 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 umbrella 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…

0 0
Add a comment Improve this question Transcribed image text
Answer #1

using System;

namespace CheggConsoleApplication
{
class Adventure
{
static void Main(string[] args)
{
string umbrella;
string fightOrRun;

// Take input for umbrella and print the message accordingly
Console.Write("It is a dark and stormy night. Do you want to take an umbrella? (Y/N): ");
umbrella = Console.ReadLine();
if (umbrella.ToUpper() == "Y")
{
Console.WriteLine("Good - you have an umbrella.");
}else
{
Console.WriteLine("You decide not to take an umbrella.");
}

// Take input for fightOrRun
// There will be 4 possibilities, print messages accordingly
Console.Write("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): ");
fightOrRun = Console.ReadLine();
if (fightOrRun.ToUpper() == "F" && umbrella.ToUpper()=="Y")
{
Console.WriteLine("You take out your umbrella and jab it into the wolf's paw! It runs away and you live another day.");
}
else if (fightOrRun.ToUpper() == "R" && umbrella.ToUpper() == "Y")
{
Console.WriteLine("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.");
}
else if (fightOrRun.ToUpper() == "F" && umbrella.ToUpper() == "N")
{
Console.WriteLine("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.");
}
else
{
Console.WriteLine("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…");
}
}
}
}

OUTPUT

PSEUDO CODE

1. Declare umbrella and fightOrRun as string
2. Ask the user to enter umbrella
3. If umbrella is Y Then
       print "Good - you have an umbrella."
   Else
       print "You decide not to take an umbrella."
4. Ask the user to enter fightOrRun
5. If fightOrRun is F and umbrella is Y Then
       print "You take out your umbrella and jab it into the wolf's paw! It runs away and you live another day."
   Else if fightOrRun is R and umbrella is Y Then
       print "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."
   Else if fightOrRun is F and umbrella is N Then
       print "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."
   Else
       print "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…"
   End

Add a comment
Know the answer?
Add Answer to:
I need help with this in C# and also the Pseudocode. Program 1: Back in my...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • IN JAVA!!! PSEUDOCODE ONLY!!! Back in my Day! Kids who grew up in the late 70s...

    IN JAVA!!! PSEUDOCODE ONLY!!! 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....

  • WRITE IN PSEUDOCODE USING THE FOLLOWING GUIDELINES Classes Program 1: WAKA, WAKA. Pac-Man was a big...

    WRITE IN PSEUDOCODE USING THE FOLLOWING GUIDELINES Classes Program 1: WAKA, WAKA. Pac-Man was a big hit back in the 80s. One of the things he could do was “teleport” from one side of the screen to the other, and that’s what we’re going to implement here. For this program, you’re going to write a class (called “PacMan”) that only has two attributes: an X and Y location. Imagine the player is on a 10x10 grid and starts at location...

  • I would really appreciate it if someone can help me with the whole question. thank you....

    I would really appreciate it if someone can help me with the whole question. thank you. You may be familiar with Newton's Second Law of Motion, SF = mā. In English, this equation says: The sum, or net, (S) of the forces (F) acting upon an object equals (=) the mass (m) of the object multiplied by the object's acceleration (ā). Even if you are familiar with this famous equation, did you notice the arrows above F and a before?...

  • I NEED HELP WITH DEBUGGING A C PROGRAM! PLEASE HEAR ME OUT AND READ THIS. I...

    I NEED HELP WITH DEBUGGING A C PROGRAM! PLEASE HEAR ME OUT AND READ THIS. I just have to explain a lot so you understand how the program should work. In C programming, write a simple program to take a text file as input and encrypt/decrypt it by reading the text bit by bit, and swap the bits if it is specified by the first line of the text file to do so (will explain below, and please let me...

  • I need help finishing my C++ coding assignment! My teacher has provided a template but I...

    I need help finishing my C++ coding assignment! My teacher has provided a template but I need help finishing it! Details are provided below and instructions are provided in the //YOU: comments of the template... My teacher has assigned a game that is similar to battleship but it is single player with an optional multiplayer AI... In the single player game you place down a destroyer, sub, battleship, and aircraft carrier onto the grid.... Then you attack the ships you...

  • I need a basic program in C to modify my program with the following instructions: Create...

    I need a basic program in C to modify my program with the following instructions: Create a program in C that will: Add an option 4 to your menu for "Play Bingo" -read in a bingo call (e,g, B6, I17, G57, G65) -checks to see if the bingo call read in is valid (i.e., G65 is not valid) -marks all the boards that have the bingo call -checks to see if there is a winner, for our purposes winning means...

  • Please, I need help with program c++. This is a chutes and ladders program. The code...

    Please, I need help with program c++. This is a chutes and ladders program. The code must be a novel code to the specifications of the problem statement. Thank you very much. Assignment Overview This program will implement a variation of the game “chutes and ladders” or “snakes and ladders:” https://en.wikipedia.org/wiki/Snakes_and_Ladders#Gameplay. Just like in the original game, landing on certain squares will jump the player ahead or behind. In this case, you are trying to reach to bottom of the...

  • I need help solving #1 and #2 so I will know how to do my quiz...

    I need help solving #1 and #2 so I will know how to do my quiz tomorrow correctly. Thank you in advance! Chapter 17 Homework Quiz Summer 2011 k,-8.99 x 10, N ㎡で Co-8.85 x 10-12 CN㎡ e -1.60x 101" C 1kWh-3.50 x 106 J Chapter 17 A0 R=a R=R11 +α(7-7, 1. A 2.00-V potential difference is maintained across a 12.0-2 resistor for a period of 2.00 s. What total charge passes through the wire in this time interval? A...

  • Friends.. I need help figuring it out this exercise. I am not sure if my answer...

    Friends.. I need help figuring it out this exercise. I am not sure if my answer is right. Thank you all for helping!! 19) The U.S. Department of Health has suggested that a healthy total cholesterol measurement should be 200 mg/dl. She conducts a study from a sample of random, independent people and the results are shown. Hypothesis test results: : Mean of population HO: 200 HAN > 200 Mean Sample Mean Std. Err. DF T-Stat P-value 208.26 5.7516066 49...

  • Help!! - I need excel with formula shown 1) Sungram, an active lifestyle company, manufactures three models of novel fitness trackers called Jump (J), Run (R), and Walk (W). They have a limited supply...

    Help!! - I need excel with formula shown 1) Sungram, an active lifestyle company, manufactures three models of novel fitness trackers called Jump (J), Run (R), and Walk (W). They have a limited supply of common parts---wifi module (450 in inventory), cellular module (250 in inventory), heart rate monitor (800 in inventory), GPS module (450 in inventory), LCD screen (600 in inventory)---that these products use. A Jump model requires a wifi module, 2 heart rate monitors, a GPS module, and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT