100% satisfaction guarantee Immediately available after payment Read online or as PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

CO1512 November 2016 exam Memo

Rating
-
Sold
1
Pages
8
Grade
A+
Uploaded on
09-11-2022
Written in
2015/2016

This is the memorandum for the November exams written in 2016

Institution
Module

Content preview

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

Connected book

Written for

Institution
Module

Document information

Uploaded on
November 9, 2022
Number of pages
8
Written in
2015/2016
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$6.07
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Read online or as PDF
No strings attached

Get to know the seller
Seller avatar
lindelanitshikalange0

Get to know the seller

Seller avatar
lindelanitshikalange0 University of South Africa (Unisa)
Follow You need to be logged in order to follow users or courses
Sold
5
Member since
3 year
Number of followers
4
Documents
14
Last sold
3 year ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Trending documents

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions