Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

RICHFIELD GRADUATE INSTITUTE OF TECHNOLOGY (PTY) LTD

HIGHER EDUCATION AND TRAINING

FACULTY OF INFORMATION TECHNOLOGY

PROGRAMMING 621 (C++) (PRACTICAL)

1st SEMESTER NATIONAL FINAL EXAMINATION

DURATION: 2 HOURS MARKS: 100 DATE: 19 NOVEMBER 2019

EXAMINER: THOKOZANI NKOSI MODERATOR: RAYMOND SHAMBA

This paper consists of 4 questions and 2 pages including this page.

PLEASE NOTE THE FOLLOWING:


1. Ensure that you are writing the correct Examination paper, and that there are no missing pages.
2. You are obliged to enter your student details on the answer sheet. The answer sheet provided
are the property of Richfield Graduate Institute of Technology (Pty) Ltd and all extra sheets must
be handed to the invigilator before you leave the examination room.
3. If you are found copying or if there are any documents / study material in your possession, or
writing on parts of your body, tissue, pencil case, desk etc. your answer sheet will be taken away
from you and endorsed accordingly. Appropriate disciplinary measures will be taken against you
for violating the code of conduct of Richfield Graduate Institute of Technology (Pty) Ltd
Examinations Board. Therefore, if any of these materials are in your possession you are requested
to hand these over to the invigilator before the official commencement of this paper.
4. The question paper consists of 2 sections.
 Section A is compulsory
 Section B comprises of 3 questions and you are required to answer only two questions

SUGGESTED TIME REQUIRED TO ANSWER THIS QUESTION PAPER


NUMBERS QUESTIONS MARKS TIME IN MINUTES
SECTION A: COMPULSORY
1 Question One (Compulsory) 40 50
SECTION B: ANSWER ANY TWO QUESTIONS
2 Question Two (Optional) 30 35
3 Question Three (Optional) 30 35
4 Question Four (Optional) 30 35
TOTAL 100 120

Initiated By Academic Director Dr Stephen Akandwanaho Document No Exams /01/2019


Authorised By Group Chief Executive Officer Stefan Ferreira Revision No 01/2015
Issuing Office Head Office – Main Campus CONTROLLED COPY Revision Date 01/10/2019
Document PROG_621 (P) Issue Date 01/10/2019

Page 1 of 2
SECTION A: (THIS SECTION IS COMPULSORY) (40 MARKS)

QUESTION ONE (40 MARKS)

1.1 Write an e- ATM C++ console application that will request a user to enter a pin code firstly
and validate it. The app should then request user to deposit any amount of money. The
app should allow user to withdraw money. If the user attempts to withdraw amount
exceeding the current balance it should show an error message.
(40)

SECTION B: ( ANSWER TWO QUESTIONS FROM THIS SECTION) (60 MARKS)

QUESTION TWO (30 MARKS)

2.1 Write a C++ program that will prompt the user to input number of element of an Array.

This program takes n number of elements from user and stores it in array arr[].
To find the largest element, the first two elements of array are checked and largest of
these two element is placed in arr[0].
Then, the first and third elements are checked and largest of these two element is placed
in arr[0]. This process continues until and first and last elements are checked.
After this process, the largest element of an array will be in arr[0] position.
(30)

QUESTION THREE (30 MARKS)

3.1 Write C++ Program to Check whether an input number is Prime number or not.

A number which is only divisible by itself and 1 is known as prime number, for example: 5
is a prime number because it is only divisible by itself and 1 (30)

QUESTION FOUR (30 MARKS)

4.1 Write a C++ program to print star pyramid patterns.


hint:

To print star pyramid patterns in C++ programming, we have to use two nested for loops.
The outer for loop is responsible for the number of rows in star (*) pyramid triangle or
patterns whereas inner for loop will print the required number of stars * in each row. (30)

TOTAL: 100 MARKS

Initiated By Academic Director Dr Stephen Akandwanaho Document No Exams /01/2019


Authorised By Group Chief Executive Officer Stefan Ferreira Revision No 01/2015
Issuing Office Head Office – Main Campus CONTROLLED COPY Revision Date 01/10/2019
Document PROG_621 (P) Issue Date 01/10/2019

Page 2 of 2

You might also like