wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Midterm Exam ICTC1023

Total questions: 40

Worksheet time: 30mins

Name
Class
Date
1.

It infers to the type that do not contain the actual data stored in a variable, but it contains a reference to the variables.

a)

reference

b)

Both a and c

c)

value

d)

variable

2.

Deduce the value to be returned by Equals( ) method

a)

TRUE or FALSE

b)

true or false

c)

TRUE

d)

FALSE

3.

The ____method in C# is declared differently from the main function in C++.

a)

Main( )

b)

Main

c)

main( )

d)

main

4.

Compare() method returns __ if string1 < string2

a)

1

b)

-1

c)

0

d)

2

5.

In C#, variables are categorized into _ types.

a)

3

b)

2

c)

5

d)

4

6.

__ property determines the length of a string

a)

Length

b)

length

c)

Length( )

d)

None of the above

7.

A method which can be used to extract a portion of a string from starting point for a specific length

a)

Substring( )

b)

Length ( )

c)

Substring

d)

None of the above

8.

There are __ pre-written methods to compare strings

a)

2

b)

3

c)

4

d)

5

9.

CompareTo( ) is a ___ method

a)

Static

b)

Non-static

10.

Compare() method returns _ if string1 == string2

a)

1

b)

2

c)

0

d)

-1

11.

Objects communicates through invoking methods and sending data to them

a)

Class Definitions

b)

Message Passing

c)

Objects

d)

one of the above

12.

It accepts input from the user and store it into a variable.

a)

ReadLine( )

b)

WriteLine( )

c)

ReadKey( )

d)

None of the above

13.

using System.Windows.Forms is the directive to create

a)

web-based application

b)

console application

c)

windows forms application

d)

None of the above

14.

It allows you to customize your form layout

a)

Form1.Designer

b)

Form1.cs

c)

Program.cs

d)

None of the above

15.

Suppose we use for (int i = 0; i < 9; i++), variable i will display

a)

0…8

b)

1…9

c)

1…8

d)

None of the above

16.

In the code, Console.WriteLine(" compare {0} to {1}: {2}", string1, string2, String.Equals(string1, string2)),


we declared

string string1 = "Cheri" , string2 = "Cherry", this will return

a)

0

b)

TRUE

c)

FALSE

d)

1

17.

The using directive System.Linq can be removed when running console application

a)

Yes

b)

No

c)

TRUE

d)

None of the above

18.

The lines of code below will not cause an error if we remove

if (number1 > number2)

{ Console.WriteLine("{0} is greater than {1} ", number1, number2) }

a)

{ }

b)

( )

c)

“ “

d)

None of the above

19.

Using C#, the keyword __ is valid

a)

else

b)

Else

c)

ELSE

d)

None of the above

20.

Using C#, the directive __ is the most important

a)

System

b)

system

c)

SYSTEM

d)

None of the above

21.

Using C#, the given conversions are valid except

a)

Convert.ToInt34

b)

Convert.ToDouble

c)

Convert.ToInt16

d)

Convert.ToString

22.

Determine what causes the error


if (grade.Equals("INC" | | grade.Equals("inc"))

a)

missing )

b)

space in | |

c)

("inc")

d)

None of the above

23.

The given declaration of strings are valid except

a)

String SemGrade

b)

string SemGrade;

c)

String SemGrade;

24.

Is there an error in the given Form1.cs code

private void button3_Click(object sender, EventArgs e)

{

MessageBox.Show("Hello " + textBox1.Text + " !!!" + "\n" + "Welcome to OOP environment.");

}

a)

None

b)

Yes - MessageBox.Show

c)

Yes - button3_Click

d)

Yes - private

25.

The default namespace is

a)

namespace ConsoleApplication1

b)

namespace ConsoleApplication

c)

namespace ConsoleApplication2

26.

Program.cs can be renamed in ____

Determine the window part

a)

Server Explorer window

b)

Solution Explorer window

c)

Properties window

27.

In OOP, dot notation is represented by

a)

Method_Name.Object_name.()

b)

Object_name.Method_Name()

28.

Use camelCase for ___

a)

class name and method name

b)

variable name and method arguments

29.

Identify what has been performed in the given line of code:

Print p = new Print( );

a)

Inheritance

b)

Instantiation

c)

Data Abstraction

d)

Classes

30.

Recognize the OOP characteristic that has been represented in the given lines of code:

private void BtnAdd_Click(object sender, EventArgs e)

{

total1 = total1 + Convert.ToDouble(txtDisplay.Text);

txtDisplay.Clear();


btnAddClick = true;

btnSubtractClick = false;

btnMultiplyClick = false;

btnDivideClick = false;

}

a)

Inheritance

b)

Data Abstraction

c)

Instantiation

31.

Form1 refers to __

a)

source file

b)

form designer

c)

main form

d)

main program

32.

Textbox, label, command button, menu, image are called __

a)

objects

b)

controls

c)

credentials

d)

forms

33.

MessageBoxButtons.YesNo constitutes a message box with command buttons Yes and No

a)

True

b)

False

34.

InitializeComponent() method in Visual Studio.NET C# is a method that is automatically created and managed by Windows Forms designer and it defines everything you see on the form. Everything done on the form in VS.NET using designers generates code.

a)

False

b)

True

35.

Refers to a template, declaration or blueprint that is used for classifying object

a)

object

b)

class

c)

namespace

d)

directive

36.

To test the function of Form1, use the method __ in the main program

a)

Application.EnableVisualStyles();

b)

Application.Run( );

c)

Application.SetCompatibleTextRenderingDefault( );

37.

The form property that displays the form in the center of the screen

a)

WindState

b)

StartPosition

c)

ShowIcon

38.

The form property that will remove the minimize, restore, close buttons of the selected form

a)

MaximizeBox

b)

ControlBox

c)

MainMenuStrip

39.

Determine the OOP characteristic exemplified in the given line of code


public partial class Form1 : Form

a)

Data Abstraction

b)

Inheritance

c)

Instantiation

d)

Polymorphism

40.

Identify the next form to be navigated in the codes below:


Calculator calc = new Calculator();

calc.Show();

this.Hide();

a)

Form2

b)

Form3

c)

Calculator

d)

calc