wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

[CSC301] Quick Exercise 4-1

Total questions: 15

Worksheet time: 15mins

Name
Class
Date
1.

Which type of statement causes a procedure to execute?

a)

Step Into

b)

Access specifier

c)

Procedure call

d)

Procedure declaration

2.

What happens when a procedure finishes executing?

a)

The application branches back to the procedure call and resumes executing at the next line

b)

The application enters break mode

c)

The application terminates

d)

The application waits for the user to trigger the next event

3.

In what way is a function different from a procedure?

a)

A function must be executed in response to an event

b)

There is no difference

c)

A function returns a value and a procedure does not

d)

A procedure returns a value and a function does not

4.

What is an argument?

a)

A value passed to a procedure or function when it is called

b)

A local variable that retains its value between procedure calls

c)

A variable that a parameter is passed into

d)

A reason not to create a procedure or function

5.

What keyword is used in a parameter declaration to specify that the argument is passed by value?

a)

ByVal

b)

Val

c)

AsValue

d)

Value

6.

When an argument is passed to a procedure this way, the procedure has access to the original argument and may make changes to it.

a)

By default

b)

By address

c)

By value

d)

By reference

7.

If an application’s menu system has a Cut command on the Edit menu, what should the MenuItem control for the command be named?

a)

mnuCut

b)

mnuEditCut

c)

mnuEdit

d)

mnuCutEdit

8.

Which of the following statements disables the mnuFilePrint object?

a)

Disable mnuFilePrint

b)

mnuFilePrint.Enabled = False

c)

mnuFilePrint.Disabled = True

d)

mnuFilePrint.Available = False

9.

Which of the following instructs a function to return the value stored in the dblBonus variable?

a)

Send dblBonus

b)

SendBack dblBonus

c)

Return dblBonus

d)

Return ByVal dblBonus

10.

If a statement passes a variable’s address, the variable is said to be passed

a)

by content

b)

by address

c)

by reference

d)

by value

11.

Which of the following statements invokes the GetDiscount function, passing it the contents of two Decimal variables named decSales and decRate? The statement should assign the function’s return value to the decDiscount variable.

a)

decDiscount = GetDiscount(ByVal decSales, ByVal decRate)

b)

decDiscount = GetDiscount(decSales, decRate)

c)

GetDiscount(decSales, decRate, decDiscount)

d)

None of the above.

12.

The horizontal line in a menu is called

a)

an item separator

b)

a separator bar

c)

a menu bar

d)

None of the above

13.

The underlined letter in a menu element’s caption is called

a)

an access key

b)

a menu key

c)

a shortcut key

d)

None of the above

14.

Which of the following is false?

a)

You should assign shortcut keys to commonly used menu titles.

b)

Menu titles should be one word only.

c)

Each menu title should have a unique access key.

d)

Menu items should be entered using book title capitalization.

15.

Which of the following terms means to divide an application’s code into small, manageable procedures?

a)

Bind

b)

Break

c)

Modularize

d)

Modularize