WorksheetsITC303 QUIZ #3
Total questions: 10
Worksheet time: 20mins
What C# loop structure only allows you to traverse all elements of an array but not alter their values?
foreach
while
do
for
Which of the following is not a valid array declaration?
int [] num = int [5];
char [] bloodType;
int days = new int [7];
char [] gender = { M, F }
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 _____;
char [26]
letters [25]
letters [26]
char [25]
What is the correct expression to determine the last index of an array?
arrName.Length-1
arrName.Length
arrName.Length + 1
0
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?
100
0
81
10
Which C# loop structure is best suited for input validations?
do-while
for
while
foreach
Which term refers to a series of statements that carry out a task?
method
class
operation
block
Which part of a method declaration determines how it is accessed by other classes?
access modifier
method name
method type
parameters
Which part of a method declaration refers to the type of data the method will return?
method type
method name
parameter
access modifier
Which part of a method declaration, determines the amount and type of data a method will be accepting from a calling method?
parameters
method name
access modifier
method body
