wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SLG IPC144 Week 9

Total questions: 14

Worksheet time: 17mins

Name
Class
Date
1.

What is the size of double* ptrPrice; on a 32-bit system?

a)

8 bytes

b)

4 bytes

c)

the size of a double

d)

32 bytes

2.

Modular Design entails

a)

separating the program into reusable and self-contained modules.

b)

making modules highly cohesive and uncoupled.

c)

simplifying a complex problem by sub-dividing it into individual aspects.

d)

making modules highly coupled.

3.

Did you understand last week's lecture on Functions?

a)

I fully understood. Functions are easy.

b)

Not at all. Prob gonna drop.

c)

I think so.

d)

Mostly, but I still have a few questions.

4.

Did you understand last week's lecture on Pointers?

a)

I fully understood Pointers. So far Pointers are easy.

b)

Not at all. Probably gonna drop cause of pointers.

c)

I think so.

d)

Mostly, but I still have a few questions.

5.

In Modular Design, Cohesion describes

a)

the degree of interrelatedness of a module with another module

b)

how focused a module is at performing only a single task

c)

the degree of interrelatedness of the datatypes within a module

d)

how focused a module is at saving memory

6.

In Modular Design, Coupling describes

a)

the degree of interrelatedness of a module with another module

b)

how focused a module is at performing only a single task

c)

the degree of interrelatedness of the datatypes within a module

d)

how focused a module is at saving memory

7.

The C language supports modular design through the use of

a)

Structures

b)

Functions

c)

Pointers

d)

Arrays

8.

Write a function prototype called power that takes two integer parameters called base and exponent, and returns an integer.

(Hint: Don't forget the semi-colon)

(a)  

9.

Call a function called power that takes two arguments

called base and exp (in that order).

(a)  

10.

Write a function prototype called countDown that takes an integer parameter called n, and returns nothing.

(Hint: Don't forget the semi-colon)

(a)  

11.

What is the difference between passing by Value and passing by Address?

4 lines
12.

How do you declare an int pointer?

a)

int *p = &x;

b)

int p = &x;

c)

int &p = x;

d)

int &p = *x;

13.

If we were to pass by address, we would use which function prototype?

a)

void swap(int *p, int *q)

b)

void swap(int p, int q)

c)

What is passing by address?

d)

void *swap(int p, int q)

14.

What are pointers?

4 lines