wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SD_Semi-Final Quiz

Total questions: 25

Worksheet time: 25mins

Name
Class
Date
1.

What is a correct syntax to output "Hello World" in C#?

a)
b)
c)
d)
2.

C# is an alias of C++

a)

True

b)

False

3.

The most common method to output something in C# is ....................

a)

WriteLine()

b)

Print

c)

cout

d)

cin

4.

How do you insert COMMENTS in C# code?

a)

# This is a comment

b)

// this a comment

c)

/* This ia a comment

5.

The types of Variables who stores floating point numbers is ..............

a)

int

b)

char

c)

double

d)

bool

6.

Which data type is used to create a variable that should store text?

a)

String

b)

Int

c)

Double

d)

Char

7.

How do you create a variable with the numeric value 5?

a)

num x = 5;

b)

int x = 5;

c)

x = 5;

d)

double x = 5;

8.

How do you create a variable with the floating number 2.8?

a)

int x = 2.8;

b)

int x = 2.8D;

c)

byte x = 2.8;

d)

double x = 2.8D;

9.

The character must be surrounded by ......................

a)

single quotes

b)

Double quotes

c)

Angle brackets

d)

Square brackets

10.

How do you write a Variable in C-Sharp?

a)

var myVariable = 10

b)

var myVariable = 10;

c)

int myVariable = 10;

d)

local myVariable = 10

11.

How to make Functions in C-Sharp?

a)

function myFunction(){

//code here

}

b)

function myFunction()

--code here

end

c)

void myFunction(){

//code here

}

d)

def myFunction(): #code here

12.

Which of the following are Assignment operators in C#?

a)

1, 2, 3

b)

1, 3, 4

c)

2, 4, 5

d)

3, 4, 5

13.

It allows to specify the code that should run, if the condition in the first if statement evaluates to false.

a)

if statement

b)

if else statement

c)

if else if else statement

d)

switch statement

14.

It allows use to execute code based on a predefined set choices.

a)

if statement

b)

if else statement

c)

if else if else statement

d)

switch statement

15.

It terminates the case in the switch statement where it is placed.

a)

end

b)

go to

c)

break

d)

continue

16.

It can be used to terminate a case in the switch statement.

a)

condition statement

b)

increment statement

c)

break statement

d)

continue statement

17.

Used to write a single line comments in a C# program

a)

/*

b)

C:

c)

//

d)

{}

18.

The Console.ReadLine() method is used to

a)

Write information to the screen/console

b)

Read information input from the user

c)

Reading lines from a file

d)

Making a space between text

19.

The Console.WriteLine() method is used to

a)

Store information in a variable

b)

Read text input from the user

c)

Print text to the console

d)

Write lines on the screen to separate sections of coding

20.

Math operators like

÷\div   ++   -   ×\times  There is one more  specificly used in coding to get the REMAINDER

a)

+=

b)

&

c)

%

d)

@

21.

thing = thing + 1; can ALSO be expressed

a)

thing + thing = thing2;

b)

thing+=1;

c)

thing++;

d)

thing(thing);

22.

To change

string thing = "holiday break";

to read "HOLIDAY BREAK"

a)

make it uppercase man

b)

thing = .ToUpper()

c)

thing.ToUpper();

d)

thing "toUpper()";

23.

The process of appending one string to the end of another string. Example: string sentence = ("This" + class + "is my favorite");

a)

plus sequence

b)

put together

c)

concatenation

d)

meow

24.

To change

string thing = "HOLIDAY BREAK";

to read "holiday break"

a)

make it lowercase man

b)

thing = .ToLower()

c)

thing.ToLower();

d)

thing "toTower()";

25.

Which of the following are NOT Relational operators in C#?

a)

1, 3

b)

2, 4

c)

3, 5

d)

4, 5