, Page 1 of 90
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?
za
5. All of the above options are correct function headers.
ls s
o.
ria al
Questions 4 and 5 are based on the following C++ program.
.c
to ori
#include <iostream>
rtu ut
#include <string>
using namespace std;
.g T
int main( )
w R
{
G
string favour;
int tvHours, favourHours;
cout << "How many hours per week do you watch sport on TV, " << endl
<< "what is your favourite sport, how many hours for that? ";
cin >> tvHours >> favour >> favourHours;
w
w
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Solutionist. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $2.65. You're not tied to anything after your purchase.