wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Self-Check

Total questions: 20

Worksheet time: 16mins

Name
Class
Date
1.
You can declare an array without dimensioning its size, but the size must be determined before you can reference it.
a)
True
b)
False
2.
In C# the length of an array cannot be changed. After it is instantiated with a length, dynamic resizing is not an option. 
a)
True
b)
False
3.
The value of price.Length is 5
a)
True
b)
False
4.
With the declaration of price, price[1] refers to
a)
2.1
b)
2.2
c)
2.3
d)
2.5
5.
To declare memory for 4 exam scores that range in value from 0 to 100, the following declaration could be made
a)
int examScore = new examScore [3];
b)
int[ ] examScore = new examScore[3];
c)
int[ ] examScore = new examScore[4];
d)
int examScore = new examScore[4];
6.
The index is also sometimes referred to as the _______ of an array.
a)
size
b)
variable
c)
subscript
d)
value
7.
Given an array declared to hold 100 values, the smallest index that can be use with the array is 
a)
based on what index is used when the first value is placed in the array
b)
0
c)
1
d)
undetermined
8.
One of the special properties in the array class is Length.  It returns
a)
an int representing the number of values currently stored in the array
b)
the length of an individual element of the array
c)
how much storage is consumed by the entire array
d)
an int representing the size of the array was dimensioned
9.
In an array, every element has the same
a)
data type
b)
subscript
c)
memory location
d)
all of the above
10.
What would be the correct declaration for a 2-dimensional array
a)
int [ ] sales = new int[2,3];
b)
int [ , , ] sales = new int [2,3];
c)
int [ , ] sales = new int [ ];
d)
int [ , ] sales = new int [2,3];
11.
In numerical 1 & 2 -dimensional arrays, if you don't provide values for elements what happens?
a)
You get a run-time error
b)
All elements default to 0
c)
you get a compile-time error
d)
All elements can not be used
12.
Two arrays that store related information in corresponding element positions are 
a)
analogous arrays
b)
polymorphic arrays
c)
relative arrays
d)
parallel arrays
13.

Which component of the .NET (Core/5+) platform is primarily responsible for managing the execution, memory, and security of compiled C# code, including Just-In-Time (JIT) compilation?

a)

The C# Compiler (CSC)     

b)

The Base Class Library (BCL)

c)

The .NET Software Development Kit (SDK)

d)

The Common Language Runtime (CLR)

14.

What is the default value of an uninitialized element in an integer array in C#?

a)

0

b)

-1

c)

null

d)

undefined

15.

Which of the following statements correctly initializes an array of strings in C#?

a)

string[] names = new string[5];

b)

string[] names = new string;

c)

string names = new string[5];

d)

string names[] = new string[5];

16.

In C#, how do you access the last element of an array named 'scores' with a length of 10?

a)

scores[10]

b)

scores[9]

c)

scores[length]

d)

scores[last]

17.

What is the maximum number of dimensions an array can have in C#?

a)

1

b)

No limit

c)

2

d)

3

18.

Which of the following correctly retrieves the first element of an array named 'data'?

a)

data[1st]

b)

data[0]

c)

data[1]

d)

data[first]

19.

In C#, what happens if you try to access an index that is out of bounds in an array?

a)

The program crashes

b)

You get a run-time error

c)

It returns 0

d)

It returns null

20.

What is the primary purpose of a WinForms application?

a)

  To create web-based applications that run in a browser.

b)

To manage server-side logic and databases for enterprise systems

c)

To develop cross-platform mobile applications for iOS and Android.

d)

To build desktop applications with a graphical user interface for the Windows operating

system.