Question: C# Programming Mad Libs - Write a program that asks the user for input for several words. Use these words to fill in a Mad
C# Programming
Mad Libs - Write a program that asks the user for input for several words. Use these words to fill in a Mad Libs style story. Ask the user if they like their story, or if they would like to try again. Continue to play the game until user says they like their story. (Need assistance with having the player continue the game)
class MainClass {
public static void Main (string[] args) {
string thing, color, verb, place, commonNoun, adjective, negativeVerb, writer;
Console.Write("Enter a thing: ");
thing = Console.ReadLine();
Console.Write("Enter a color: ");
color = Console.ReadLine();
Console.Write("Enter a verb: ");
verb = Console.ReadLine();
Console.Write("Enter a place: ");
place = Console.ReadLine();
Console.Write("Enter a commonNoun: ");
commonNoun = Console.ReadLine();
Console.Write("Enter a adjective: ");
adjective = Console.ReadLine();
Console.Write("Enter a negativeVerb: ");
negativeVerb = Console.ReadLine();
Console.WriteLine ("Frozen - Let It Go");
Console.WriteLine ("The " + thing + " glows " + color + " on the mountain tonight");
Console.WriteLine ("Not a footprint to be " + verb);
Console.WriteLine ("A " + place + " of isolation");
Console.WriteLine ("And it looks like I'm the " + commonNoun);
Console.WriteLine ("The wind is " + adjective + " like this swirling storm inside");
Console.WriteLine (negativeVerb + " keep it in, heaven knows I've tried");
Console.Write(" Do you like your story? ");
writer = Console.ReadLine();
while(true)
{
if(writer == "no" || writer == "NO")
{
Console.Write(" Would you like to try again? ");
Console.ReadLine();
continue;
}
else if(writer == "yes" || writer == "YES")
{
Console.WriteLine("GREAT!");
}
break;
}
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
