Font size
WorksheetsSLG IPC144 Week 9
Total questions: 14
Worksheet time: 17mins
What is the size of double* ptrPrice; on a 32-bit system?
8 bytes
4 bytes
the size of a double
32 bytes
Modular Design entails
separating the program into reusable and self-contained modules.
making modules highly cohesive and uncoupled.
simplifying a complex problem by sub-dividing it into individual aspects.
making modules highly coupled.
Did you understand last week's lecture on Functions?
I fully understood. Functions are easy.
Not at all. Prob gonna drop.
I think so.
Mostly, but I still have a few questions.
Did you understand last week's lecture on Pointers?
I fully understood Pointers. So far Pointers are easy.
Not at all. Probably gonna drop cause of pointers.
I think so.
Mostly, but I still have a few questions.
In Modular Design, Cohesion describes
the degree of interrelatedness of a module with another module
how focused a module is at performing only a single task
the degree of interrelatedness of the datatypes within a module
how focused a module is at saving memory
In Modular Design, Coupling describes
the degree of interrelatedness of a module with another module
how focused a module is at performing only a single task
the degree of interrelatedness of the datatypes within a module
how focused a module is at saving memory
The C language supports modular design through the use of
Structures
Functions
Pointers
Arrays
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)
Call a function called power that takes two arguments
called base and exp (in that order).
(a)
Write a function prototype called countDown that takes an integer parameter called n, and returns nothing.
(Hint: Don't forget the semi-colon)
(a)
What is the difference between passing by Value and passing by Address?
How do you declare an int pointer?
int *p = &x;
int p = &x;
int &p = x;
int &p = *x;
If we were to pass by address, we would use which function prototype?
void swap(int *p, int *q)
void swap(int p, int q)
What is passing by address?
void *swap(int p, int q)
What are pointers?
