Resolved Nesting not working properly

QuantumMan345

New member
Joined
Feb 10, 2021
Messages
2
Programming Experience
Beginner
For some reason, whenever I try to run the code below, it gives me these two errors:
Compilation error (line 17, col 3): } expected
Compilation error (line 43, col 1): Member definition, statement, or end-of-file expected
I am not sure about the first one, since I counted and the right amount of brackets are there and I don't understand what the second one is saying.
C#:
using System;
public bool start = true;
public string Name;
public string Continue;
public bool StartAdventure;
private bool NameEntered;
private double go;

for(go = 1; go < 5; --go)
{
if(start == true)
    {
        Console.WriteLine("Enter Your Name Here");
        Name = String.Copy(Console.ReadLine());
        start = false;
        NameEntered = true;
    }

    public class Player
    {
        public static void Main()
        {
        }

        

    }
if(NameEntered == true)
{
    Console.WriteLine("Is {0:N} Correct? Y/N", Name);
    Continue = Console.ReadLine();
    NameEntered = false;
}

if(Continue == "y")
{
    StartAdventure = true;
}
else
{
    start = true;
}
}
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,554
Location
Sydney, Australia
Programming Experience
10+
If your issue has been resolved, please use the option above the first post to mark the thread Resolved. That way, we'll know that you don't need any more help without opening the thread and reading the whole thing.
 
Top Bottom