Mastervincent
HRM3706 SUMMARISED NOTES
COS1511 EXAM
PACK
FOR ASSISTANCE CONTACT
, lOMoARcPSD|56105791
SECTION A 20 MARKS (10 MULTIPLE CHOICE QUESTIONS, 2 marks each)
Please answer this section on the mark-reading sheet that you received (not in your answer book).
Choose one option for every question.
QUESTION 1
Suppose the following declarations appear in a C++ program:
float amount, forWaiter;
char service;
If the following function header is given:
float tip(float amountP, char serviceP)
which of the options below is a correct calling statement of the function tip?
1. forWaiter = tip(float amount, char service);
2. tip(amountP, serviceP);
3. forWaiter = tip(123.66, 'A');
4. forWaiter = tip(amountP, serviceP);
5. None of the above options is a correct calling statement.
QUESTION 2
Suppose the following declarations appear in a C++ program:
float afford, amount;
int number;
string name;
If the following function header is given:
void supplyInfo(float affordP, int nrP, string & nameP, float & amountP)
which of the options below is a correct calling statement of the function supplyInfo?
1. supplyInfo(800, 4, "Beach Hotel", 789);
2. supplyInfo(800, 4, name, amount);
3. supplyInfo(affordP, nrP, nameP, amountP);
4. supplyInfo(afford, number, "Beach Hotel", 789);
5. None of the above options is a correct calling statement.
Downloaded by Vincent kyalo ()
HRM3706 SUMMARISED NOTES
COS1511 EXAM
PACK
FOR ASSISTANCE CONTACT
, lOMoARcPSD|56105791
SECTION A 20 MARKS (10 MULTIPLE CHOICE QUESTIONS, 2 marks each)
Please answer this section on the mark-reading sheet that you received (not in your answer book).
Choose one option for every question.
QUESTION 1
Suppose the following declarations appear in a C++ program:
float amount, forWaiter;
char service;
If the following function header is given:
float tip(float amountP, char serviceP)
which of the options below is a correct calling statement of the function tip?
1. forWaiter = tip(float amount, char service);
2. tip(amountP, serviceP);
3. forWaiter = tip(123.66, 'A');
4. forWaiter = tip(amountP, serviceP);
5. None of the above options is a correct calling statement.
QUESTION 2
Suppose the following declarations appear in a C++ program:
float afford, amount;
int number;
string name;
If the following function header is given:
void supplyInfo(float affordP, int nrP, string & nameP, float & amountP)
which of the options below is a correct calling statement of the function supplyInfo?
1. supplyInfo(800, 4, "Beach Hotel", 789);
2. supplyInfo(800, 4, name, amount);
3. supplyInfo(affordP, nrP, nameP, amountP);
4. supplyInfo(afford, number, "Beach Hotel", 789);
5. None of the above options is a correct calling statement.
Downloaded by Vincent kyalo ()