COS1512 - Introduction to Programming II (COS1512)
Institution
University Of South Africa (Unisa)
This exam pack contains exam papers and memorandums from 2014 through to 2017. It has a total of 7 exam papers that have been compiled from UNISA model answers and tutors. Not only is this an excellent learning tool but actual questions have repeated themselves several times. This is a must have to...
COS1512 - Introduction to Programming II (COS1512)
All documents for this subject (51)
2
reviews
By: lukedutoit • 4 year ago
By: prenash • 4 year ago
Seller
Follow
neilgovender2020
Reviews received
Content preview
This EXAM PACK contains the following solutions:
• COS1512 – May/ June 2014
• COS1512 – May/ June 2015
• COS1512 – Oct/ Nov 2015
• COS1512 – May/ June 2016
• COS1512 – Oct/ Nov 2016
• COS1512 – May/June 2017 P1
• COS1512 – May/June 2017 P2
, COS1512/104/2/2015
5 LAYOUT OF EXAMINATION PAPER
This section provides estimates of the marks allocated per question to different sections of the
work. You will need to know all the work which has been outlined in Tutorial Letter 101. The mark
allocation will approximately be as follows:
Please note that we test all the work. This outline points out the most important aspects tested in
each question.
6 PREVIOUS EXAMINATION PAPER
The examination paper which is used for this section is on myUnisa. It is the May/June 2014
examination paper. Please download the examination paper. We have only included the
memorandum for the examination.
4.1 if (n == 0) (1)
4.2 We are busy with recursion111 (1)
1. #include <fstream> // file i/o
2. ifstream input;
3. input.open(name);
if(!input)
{
cout << "Cannot open file " << name << " Aborting." << endl;
6
, COS1512/104/2/2015
exit (1);
}
4. while(input)
5. input.close();
The declaration int * pOne; declares pOne to be a pointer pointing to an int value. (1)
The declaration int vTwo; declares pTwo as an int value. (1)
The statement int * pThree = &vTwo; declares a pointer to an integer and initializes it with the
address of another variable of vTwo. (1)
The declaration int * q = p; declares q to be a pointer pointing to the same int to which p points.
The assignment n = *p; assigns to n the int to which p points. (2)
6.2.2 The declaration int & r = n; declares r to be a reference for the int variable n. (2)
The assignment p = &n; assigns the address of n to the pointer p.
class Product
{
public:
Product();
Product(long, double, double, long);
void display();
double retailPrice();
void modify();
Product increment();
Product decrement();
private:
long id;
double price;
double markup;
long number;
};
#include <iostream>
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
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 neilgovender2020. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $10.57. You're not tied to anything after your purchase.