Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

ITC303 QUIZ #3

Total questions: 10

Worksheet time: 20mins

Name
Class
Date
1.

What C# loop structure only allows you to traverse all elements of an array but not alter their values?

a)

foreach

b)

while

c)

do

d)

for

2.

Which of the following is not a valid array declaration?

a)

int [] num = int [5];

b)

char [] bloodType;

c)

int days = new int [7];

d)

char [] gender = { M, F }

3.

Fill in the blank to complete the array declaration, assume that the array is suppose to contain the letters of the standard English alphabet: char [] alphabet = new _____;

a)

char [26]

b)

letters [25]

c)

letters [26]

d)

char [25]

4.

What is the correct expression to determine the last index of an array?

a)

arrName.Length-1

b)

arrName.Length

c)

arrName.Length + 1

d)

0

5.

Consider the following code: for(int i = 0; i < 10; i++) { for(int j = 0; j < 10; j++) { loop statements; }} How many times would the statements inside the loop be executed?

a)

100

b)

0

c)

81

d)

10

6.

Which C# loop structure is best suited for input validations?

a)

do-while

b)

for

c)

while

d)

foreach

7.

Which term refers to a series of statements that carry out a task?

a)

method

b)

class

c)

operation

d)

block

8.

Which part of a method declaration determines how it is accessed by other classes?

a)

access modifier

b)

method name

c)

method type

d)

parameters

9.

Which part of a method declaration refers to the type of data the method will return?

a)

method type

b)

method name

c)

parameter

d)

access modifier

10.

Which part of a method declaration, determines the amount and type of data a method will be accepting from a calling method?

a)

parameters

b)

method name

c)

access modifier

d)

method body