wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C# 101 Assessment

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.

Which of the following is a named location in computer memory?

a)

Stack

b)

Variable

c)

For Loop

d)

Heap

2.

What's the data type?


-3

a)

int

b)

bool

c)

string

d)

double

3.

What's the data type?


"Hello World"

a)

int

b)

bool

c)

string

d)

double

4.

What's the data type?


Convert.ToInt32(Console.ReadLine())

a)

int

b)

bool

c)

string

d)

double

5.

Choose the value that is a double

a)

7

b)

7.8

c)

"Seven point eight"

d)

true

6.

Will this code work?

a)

Yes

b)

No

c)

Maybe

d)

I don't know

7.

For an int variable called myValue, how would you check if it is equal to 4?

a)

if (myValue = 4)

b)

if (myValue >= 4)

c)

if (4 = myValue)

d)

if (myValue == 4)

8.

What's the value?


100 >= 100

a)

true

b)

false

9.

What's the output?

a)

High School

b)

High School!

c)

Middle School

d)

Ninth Grade

10.

What's the value of y?


int x = 2 + 3;

int y = x * 5;

a)

5

b)

17

c)

55555

d)

25

11.

How many times will this loop execute?

a)

0

b)

8

c)

9

d)

10

12.

In C#, what is a method?

a)

A literal that represents a null reference

b)

A construct that executes a block of statements repeatedly until a condition is false

c)

A construct that identifies which statement to run based on the value of a Boolean expression

d)

A code block that contains a series of statements

13.

How would you call this method?

a)

Console.WriteLine("Jordan");

b)

MyName();

c)

MyName("Jordan");

d)

call(MyName)

14.

In C#, what is a construct that identifies which statement to run based on the value of a Boolean expression?

a)

if

b)

else

c)

switch

d)

for

15.

How do you display a message of Welcome?

a)

Console.WriteLine("Hello World");

b)

Console.ReadLine("Welcome");

c)

Console.WriteLine("Welcome");

d)

Cosnole.WriteLine(Welcome);

16.

How would you visit each item in a List?

a)

if statement

b)

method

c)

foreach loop

d)

List<int> myList;

17.

How would you access the first item of a list named myVegetables?

a)

myVegetables(0)

b)

myVegetables(1)

c)

myVegetables[0]

d)

Console.WriteLine("myVegetables")

18.

How many times will the loop execute?

a)

0

b)

1

c)

10

d)

Infinity

19.

In C#, what is a variable?

a)

A named location in memory

b)

A block of code with multiple statements

c)

A number

d)

A data type

20.

In C#, how do you get input from the user?

a)

string input = Console.WriteLine("Enter");

b)

string input = Console.WriteLine();

c)

string input = Console.ReadLine();

d)

Console.ReadLine(input);