WorksheetsC# review
Total questions: 15
Worksheet time: 8mins
C# is case sensitive
True
False
Both the beginning and the ending of lines of code in C# must have
()
{}
/\
: :
File names in C# end in
.cs
.bat
.that's it
;
The first section of code for C# that tells the computer what we want to write the code in is
an importing namespace section
a namespace declaration section
a main method section
In C#, the name of the project or file is:
the importing namespace section
the namespace declaration section
the class declaration section
the main method section
In C#, the starting point of the application is
the importing namespace section
the namespace declaration section
the class declaration section
the main method section
In C#, to display a message on the console window, use:
Write("string")
Read()
Clear()
ReadKey()
In C#, to write a method but to automatically move the cursor to the next line after printing the method, use:
Write("string")
WriteLine("string")
Write(variable)
Resetcolor()
In C#, to accept user input for a variable, you need to use the code
ReadLine()
Input()
WriteLine()
InputVariable()
Convert.ToInt32(Console.ReadLine();
in C#, this is used to:
input an integer as a variable
to end the program
to start the program
to initiate self destruct mode
Which code is written correctly in C@?
Console.WriteLine("What is your name?");
WriteLine("What is your name?"):
print("What is your name?")
Console.WriteLine: What is your name?
Which of the following is written correctly for C#?
namespace UserInputVariables
{
}
namespace UserInputVariables
namespace userinputvariables
{
}
namespace ("User Input Variables")
In C#, examples of relational operators are
== > <
if statements
else statements
Write.Line
Below is an example of a(n) ______________
if (userInputVariable==”Dave”)
Console.WriteLine (“Hello Dave”);
else
Console.WriteLine(“You’re not Dave!);
conditional statement
relational operator
variable
logical operator
in C#, to compare more than one condition at a time, you use a(n)__________ such as AND, OR, NOT, or XOR
logical operator
variable
relational operator
:
