NEW
Font size
WorksheetsC# 101 Assessment
Total questions: 20
Worksheet time: 11mins
Which of the following is a named location in computer memory?
Stack
Variable
For Loop
Heap
What's the data type?
-3
int
bool
string
double
What's the data type?
"Hello World"
int
bool
string
double
What's the data type?
Convert.ToInt32(Console.ReadLine())
int
bool
string
double
Choose the value that is a double
7
7.8
"Seven point eight"
true
Will this code work?
Yes
No
Maybe
I don't know
For an int variable called myValue, how would you check if it is equal to 4?
if (myValue = 4)
if (myValue >= 4)
if (4 = myValue)
if (myValue == 4)
What's the value?
100 >= 100
true
false
What's the output?
High School
High School!
Middle School
Ninth Grade
What's the value of y?
int x = 2 + 3;
int y = x * 5;
5
17
55555
25
How many times will this loop execute?
0
8
9
10
In C#, what is a method?
A literal that represents a null reference
A construct that executes a block of statements repeatedly until a condition is false
A construct that identifies which statement to run based on the value of a Boolean expression
A code block that contains a series of statements
How would you call this method?
Console.WriteLine("Jordan");
MyName();
MyName("Jordan");
call(MyName)
In C#, what is a construct that identifies which statement to run based on the value of a Boolean expression?
if
else
switch
for
How do you display a message of Welcome?
Console.WriteLine("Hello World");
Console.ReadLine("Welcome");
Console.WriteLine("Welcome");
Cosnole.WriteLine(Welcome);
How would you visit each item in a List?
if statement
method
foreach loop
List<int> myList;
How would you access the first item of a list named myVegetables?
myVegetables(0)
myVegetables(1)
myVegetables[0]
Console.WriteLine("myVegetables")
How many times will the loop execute?
0
1
10
Infinity
In C#, what is a variable?
A named location in memory
A block of code with multiple statements
A number
A data type
In C#, how do you get input from the user?
string input = Console.WriteLine("Enter");
string input = Console.WriteLine();
string input = Console.ReadLine();
Console.ReadLine(input);
