+ 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?
20 Respostas
+ 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
+ 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.
+ 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.
+ 1
Can you post your code ?
+ 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 ?
+ 1
https://code.sololearn.com/cOdaRwV1JKgj/?ref=app
Let's just say that it's a work in progress...
+ 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)
+ 1
Thank you sneeze šš
+ 1
Do you now how we can choose a random number, please?
+ 1
https://www.c-sharpcorner.com/article/generating-random-number-and-string-in-C-Sharp/
Use the type "random"
And the method "next"
To generate a number
https://www.dotnetperls.com/random
+ 1
Thanks a lot!
+ 1
There are still 2 errors that I don't understand. May you help me please?
+ 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);
+ 1
Hello! What does "Compilation error " mean?
+ 1
And there are still 2 errors I don't understand :
https://code.sololearn.com/cOdaRwV1JKgj/?ref=app
+ 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
+ 1
Thanks, now I understand what does a compile error stand for... But there are other errors I like you to check, please.
+ 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).
+ 1
Well done. Keep coding, keep asking.