Can someone explain me what does the "Type or namespace definition, or end-of-file expected" error mean please. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can someone explain me what does the "Type or namespace definition, or end-of-file expected" error mean please.

In my script, I have an error named "Type or namespace definition, or end-of-file expected" and I don't know what it does mean. May anyone help me please?

30th May 2019, 5:43 PM
Kurumi YT
Kurumi YT - avatar
20 Answers
+ 2
Well done. //dogRdn.Next(0,101); //int dogDetermination = dogRdn; int dogDetermination = dogRdn.Next(0,101); The result of dogRdn.Next is a integer. This result should be assigned to a variable. So combine the two statement to one statement. The variaible "int dogDetermination" is declared twice. Once as a variable and Second as a parameter Change (line 48) void DogBarks(int dogDetermination) To void DogBarks(int dogDetermination_param) And the code works fine
3rd Jun 2019, 2:21 PM
sneeze
sneeze - avatar
+ 1
What language do you use, please put the language you use in the tags. Count { and }, you are probably missing one. They should pair.
30th May 2019, 5:49 PM
sneeze
sneeze - avatar
+ 1
It is C# : I count and there are as many { as }. And there are a lot of errors like these in my console... Thank you for your advice, but I think that it's another thing do this.
30th May 2019, 6:16 PM
Kurumi YT
Kurumi YT - avatar
+ 1
Can you post your code ?
30th May 2019, 6:21 PM
sneeze
sneeze - avatar
+ 1
I guess u have problem with u r software better uninstall it and reinstall it . Or else some library files might be corrupted . Or esle share me u r code let me have a glance on it . U r working on MS Vs 2017 ?
30th May 2019, 6:55 PM
Prashanth Manna
Prashanth Manna - avatar
+ 1
https://code.sololearn.com/cOdaRwV1JKgj/?ref=app Let's just say that it's a work in progress...
31st May 2019, 3:13 PM
Kurumi YT
Kurumi YT - avatar
+ 1
Did some changes this is my code for you https://code.sololearn.com/cEQzq5cHYIlt These are points to learn from not mistakes. // a bracket in a strange place on line 16 int z = Console.ReadLine();} Console.ReadLine returns a string, you need to convert that to a int int x = int.Parse(Console.ReadLine()); public in line 18 does not make the variable dogDetermination available in DogBarks. Please give dogDetermination to the method using a parameter static void DogBarks(int dogdetermination)
31st May 2019, 9:37 PM
sneeze
sneeze - avatar
+ 1
Thank you sneeze 😀👍
1st Jun 2019, 6:56 AM
Kurumi YT
Kurumi YT - avatar
+ 1
Do you now how we can choose a random number, please?
1st Jun 2019, 8:30 AM
Kurumi YT
Kurumi YT - avatar
1st Jun 2019, 8:33 AM
sneeze
sneeze - avatar
+ 1
Thanks a lot!
1st Jun 2019, 8:33 AM
Kurumi YT
Kurumi YT - avatar
+ 1
There are still 2 errors that I don't understand. May you help me please?
1st Jun 2019, 8:52 AM
Kurumi YT
Kurumi YT - avatar
1st Jun 2019, 9:39 AM
Kurumi YT
Kurumi YT - avatar
+ 1
Please elaborate more. Read the links, there is more information in there. You need to create a random object Random Rnd = new Random(); Rnd.Next(0,101);
1st Jun 2019, 11:08 AM
sneeze
sneeze - avatar
+ 1
Hello! What does "Compilation error " mean?
3rd Jun 2019, 7:05 AM
Kurumi YT
Kurumi YT - avatar
+ 1
And there are still 2 errors I don't understand : https://code.sololearn.com/cOdaRwV1JKgj/?ref=app
3rd Jun 2019, 7:12 AM
Kurumi YT
Kurumi YT - avatar
+ 1
A compilation error is a error that cause your program not to start running. It needs to be solved before you can run the program. https://www.dotnetperls.com/compile-time-error
3rd Jun 2019, 1:14 PM
sneeze
sneeze - avatar
+ 1
Thanks, now I understand what does a compile error stand for... But there are other errors I like you to check, please.
3rd Jun 2019, 2:01 PM
Kurumi YT
Kurumi YT - avatar
+ 1
Here it is : https://code.sololearn.com/cOdaRwV1JKgj/?ref=app Thanks you, sneeze, for your help and your support. I learned some essential things to code in C# (the language of Unity3D).
3rd Jun 2019, 4:55 PM
Kurumi YT
Kurumi YT - avatar
+ 1
Well done. Keep coding, keep asking.
3rd Jun 2019, 4:59 PM
sneeze
sneeze - avatar