wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

C# review

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

C# is case sensitive

a)

True

b)

False

2.

Both the beginning and the ending of lines of code in C# must have

a)

()

b)

{}

c)

/\

d)

: :

3.

File names in C# end in

a)

.cs

b)

.bat

c)

.that's it

d)

;

4.

The first section of code for C# that tells the computer what we want to write the code in is

a)

an importing namespace section

b)

a namespace declaration section

c)

a main method section

5.

In C#, the name of the project or file is:

a)

the importing namespace section

b)

the namespace declaration section

c)

the class declaration section

d)

the main method section

6.

In C#, the starting point of the application is

a)

the importing namespace section

b)

the namespace declaration section

c)

the class declaration section

d)

the main method section

7.

In C#, to display a message on the console window, use:

a)

Write("string")

b)

Read()

c)

Clear()

d)

ReadKey()

8.

In C#, to write a method but to automatically move the cursor to the next line after printing the method, use:

a)

Write("string")

b)

WriteLine("string")

c)

Write(variable)

d)

Resetcolor()

9.

In C#, to accept user input for a variable, you need to use the code

a)

ReadLine()

b)

Input()

c)

WriteLine()

d)

InputVariable()

10.

Convert.ToInt32(Console.ReadLine();


in C#, this is used to:

a)

input an integer as a variable

b)

to end the program

c)

to start the program

d)

to initiate self destruct mode

11.

Which code is written correctly in C@?

a)

Console.WriteLine("What is your name?");

b)

WriteLine("What is your name?"):

c)

print("What is your name?")

d)

Console.WriteLine: What is your name?

12.

Which of the following is written correctly for C#?

a)

namespace UserInputVariables

{

}

b)

namespace UserInputVariables

c)

namespace userinputvariables

{

}

d)

namespace ("User Input Variables")

13.

In C#, examples of relational operators are

a)

== > <

b)

if statements

c)

else statements

d)

Write.Line

14.

Below is an example of a(n) ______________


if (userInputVariable==”Dave”)

Console.WriteLine (“Hello Dave”);

else

Console.WriteLine(“You’re not Dave!);

a)

conditional statement

b)

relational operator

c)

variable

d)

logical operator

15.

in C#, to compare more than one condition at a time, you use a(n)__________ such as AND, OR, NOT, or XOR

a)

logical operator

b)

variable

c)

relational operator

d)

: