CSharp Scripting Help Needed

Hey Guys Need Some Scripting Help in CSharp
Any Help Would Be Greatly Appreciated the //stuff is were the problems are. Thanks

namespace IFStatement
{
class MainClass
{
public static void Main (string[ ] args)
{
begin:

Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine(“PickANumberBetween1and4”);

int UserNumber = int.Parse(Console.ReadLine ());

if (UserNumber == 1)
{
Console.WriteLine (“\nWhatsYourName?”);
Console.ReadLine ();
Console.WriteLine (“\nThatsANiceName”);
}

else if (UserNumber == 2)
{
Console.WriteLine (“\nHowOldAreYou?”);

int age = Convert.ToInt32(Console.ReadLine ());

if (age < 20)
{
Console.WriteLine (“\nWhatIsYourDreamJob?”);
Console.ReadLine ();
Console.WriteLine (“\nOhCoolIHaveAllwaysWantedToDoThat!”);
}
else
{
Console.WriteLine (“\nDoYouAlreadyHaveAJob,YesOrNo.”);

string answer = Console.ReadLine ();
if (answer == “yes”)
{
Console.WriteLine(“\nSoWhatDoYouDo?”);
Console.ReadLine();
Console.WriteLine(“\nThatSoundsFun!”);
}
else
{
Console.WriteLine(“\nYouShouldProbablyGetAJob:/”);
}
}
}

else if (UserNumber == 3)
{
Console.WriteLine (“\nDoYouLikeCoding?YesOrNo”);

string Useranswer = Console.ReadLine ();
if (Useranswer == “yes”)
{
Console.WriteLine (“\nAwesome!”);
}
else
{
Console.WriteLine (“\nWhyNot?”);
Console.ReadLine ();
Console.WriteLine (“\nOh:(”);
}
}

else if
{ // Expecting a ( not A {
Console.WriteLine(“\nWhatsYourFavouriteColour?”);
Console.ReadLine();
Console.WriteLine (“\nThatsMyFavouriteColourToo!”);
}

else // unexpected symbol “else”
{
Console.WriteLine(“\nDoYouWantToPlayAGame?”);

string Answer = Console.ReadLine();
if (Answer == “yes”)
{
start:
Console.WriteLine(“Awesome,EyeSpyWithMyLittleEyeSomthingBegginingWith…S”);

string GameAnswer = Console.ReadKey();
if (GameAnswer == “Screen”)
{
Console.WriteLine(“WellDone,YouGotIt!”);
}
else
{
Console.WriteLine(“IAmSorryYouGotItWrong,DoYouWantToTryAgain?”);

string Continue = Console.ReadLine();
if (Continue ==“yes”)
{
goto start;
}
else
{
;
}
}
}
}

Console.WriteLine (“\nDoYouWishToContinue?YesOrNo.”);

string UserAnswer = Console.ReadLine();
if (UserAnswer == “yes”)
{
goto begin;}
else
{
;
}
}
}
}

First of all: Code tags. Your code is unreadable without them.
Second, copy and paste the error messages into your post.

2 Likes

This is also code that would never work in Unity. Judging by that and the fact that you spammed the same post in a few different places I’d say you didn’t even bother to see what kind of forum this was…

3 Likes

Looks to me like a student trying to cheat on an assignment by getting someone to do it for them.

3 Likes

Ya I don’t understand people that do that, no one has to take programming that dosnt want to, so you think anyone taking it would have the drive to so their own work. But it seems I’m wrong.

To make it short:
“else if” needs a condition, that’s what the error message says. Because of this error the “else” throws also an error, too.