100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CO1512 November 2016 exam Memo R100,00
Add to cart

Exam (elaborations)

CO1512 November 2016 exam Memo

 28 views  1 purchase

This is the memorandum for the November exams written in 2016

Preview 2 out of 8  pages

  • November 9, 2022
  • 8
  • 2015/2016
  • Exam (elaborations)
  • Questions & answers
book image

Book Title:

Author(s):

  • Edition:
  • ISBN:
  • Edition:
All documents for this subject (51)
avatar-seller
lindelanitshikalange0
COS1512_Nov2016_MEMO Tutorials Campus www.tutorialscampus.co.za


Question 1

1.1 strcpy(saveWord, word); // C-strings use the function strcpy to copy one string to another

1.2 if(strcmp(word, saveWord)) // C-strings use the function strcmp to compare two strings

1.3 int j = 4;

Question 2

2.1




2.2

void count(int counter)



2.3

count(--counter);



2.4

assert(counter>=0);



Question 3

3.1

a = (*p1 *2) /5;



3.2

Creating a new int nameless variable an assigning the pointer p1 to point to it

3.3

We cannot assign the address of pointer p1 to another pointer p2, because it has been deleted


pg. 1  for more information contact Nicholas on 083 33 13 124

, COS1512_Nov2016_MEMO Tutorials Campus www.tutorialscampus.co.za


3.4

p3 = &a;



3.5

To access actual value that pointer p3 is pointing to.



Question 4

4.1

#ifndef BURSARY_H

#define BURSARY_H



#include <iostream>

using namespace std;



class Bursary

{
public:

Bursary();

Bursary(int studentNumberP, int yearsOfStudentP, int modulesPassedP);

~Bursary();

int get_Number();

void yearOfStudy(int yearsOfStudent);

friend bool operator==(const Bursary & bursary1, const Bursary & bursary2);

friend istream& operator>>(istream& ins, Bursary& b);



private:

int studentNumber;

int yearsOfStudent;

int modulesPassed;



};

pg. 2  for more information contact Nicholas on 083 33 13 124

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

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

Quick and easy check-out

You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

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 this summary from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller lindelanitshikalange0. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy this summary for R100,00. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

53068 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy summaries for 14 years now

Start selling
R100,00  1x  sold
  • (0)
Add to cart
Added