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

TITLE HET: DIPLOMA IN INFORMATION TECHNOLOGY

SUBJECT PROGRAMMING 3B
SUBJECT CODE PRG320
TEST/EXAM EXAMINATION
SEMESTER 2ND
DATE WRITTEN 24 November 2023

TOTAL MARKS 140


DURATION 3 HOURS
PASS MARK 50%
WEIGHTING 50%
EXAMINER Bongani Gadlela
MODERATOR Setfree Magenja

REQUIREMENTS:
Learner Requirements: Stationery and Examination Book
Equipment Requirements: PC with Visual C# and MS Word

This paper consists of:


1. Section marks A : Definitions 20
2. Section marks B : Short Questions 50
3. Section marks C : Practical 70

Please answer ALL questions.

Create a folder on the desktop with your name, surname, module name (PRG320)
and assessment date.
E.g. John Smith, Prg320, 01-01-2016
Save all project folders into this folder.

Please copy all source code and take screenshots of running programs/interface and
paste into a word document. Save in your folder.

PLEASE READ THE ASSESSMENT RULES AND REGULATIONS THAT FOLLOW


Learners are warned that contravening any of the examination rules or disobeying the
instructions of an invigilator could result in the examination being declared invalid.
Disciplinary measures will be taken which may result in the students’ expulsion from
Damelin.

1
ASSESSMENT RULES AND REGULATIONS

Please ensure that you have read and fully understand the following assessment rules and regulations
prior to commencing with your assessment:

1. To be permitted access to the examination, a learner must arrive with:


- an Identity Document or other official proof of identity (for example,
- a student card, passport or driver's licence card with photo); and
- the required exam stationery.
2. No learner may enter the examination room more than 30 minutes after the examination sitting
has commenced and no candidate may leave the room less than one hour after the examination
sitting has commenced.
3. No extra time will be allowed should a student arrive late.
4. All learners must sign the Attendance Register for the examination on arrival.
5. It is the responsibility of learners to familiarise themselves with the
examination rules prior to sitting for the examination.
6. All examinations are to be written on the date and time officially stipulated by the College.
7. It is the responsibility of learners to ensure that they are writing the correct paper and that
the question paper is complete
8. Cell phones must be switched off prior to entering the exam venue. Cell phones and wallets
may be placed under candidates' chairs rather than at the front of the room.
9. Learners may not handle cell phones or wallets during the exam.
10. No weapon of any description may be taken into the assessment room.
11. All personal belongings are to be placed at the front of the examination room. Personal
belongings brought to the examination are at the owner's risk.
12. Smoking is not permitted and learners will not be allowed to leave the examination room in
order to smoke
13. Once the examination has commenced, all conversation of any form between
candidates must cease until after candidates have left the room, after the examination.
14. Only the official College examination book, as supplied by the College, may be used.
15. Learners must ensure that their student number is written on the answer book.
16. Learners are responsible for ensuring that they follow the instructions in the
examination for submitting their answers.
17. Please read the instruction appearing on the examination paper carefully
18. The number of every question must be clearly indicated at the top of every answer.
19. No pages may be torn out of the answer book. All question papers and scrap paper must be
handed to the invigilator after the examination.
20. Learners finishing earlier are to leave the examination room as quietly as possible on the
instruction of the invigilator, and may not talk until outside the building where the examination
is being written.
21. Only under exceptional circumstances will a learner be permitted to leave the examination
room during the examination, and if the invigilator gives permission.An invigilator must
accompany the learner. Only one learner at a time may be absent from the examination
room.
22. Candidates may not act dishonestly in any respect.

3
Section A [20 Marks]

Question 1 (20 Marks)

Define the following terms : Each answer is worth 2 marks

1.1. Overloading
1.2. Instance variables
1.3. Property
1.4. Contextual keywords
1.5. Interface
1.6. Inheritance
1.7. Implicit reference conversion
1.8. Exception handling
1.9. Serialization
1.10. Structured Query Language
Section B [50 Marks]

Short Questions

Question 2 (24 Marks)

2.1. Provide the instantiation of an object from the class Employee that uses the default
constructor. (2)

2.2. Write in full the set of statements/implementation that the given auto implemented
property would have automatically created. (12)

public double Salary {get; set;}

private int idNumber;

2.3. Draw a class diagram that shows how the Commission Employee class
with the field commission Rate inherits from the Employee class with the
fields empnum,
empSal and a method GetGreeting() (10)
Question 3 (10 Marks)

Differentiate between the following terms:

3.1. Constructor and Destructor (5)

3.2. Console.In and Console.Out (2)

3.3. SQL and LINQ (3)

6
Question 4 (16 Marks)

Write a console application that would request a number from the user.

Calculate and display the square root of the entered number.

If a negative value is entered then throw an exception, set the square root value to zero
and display an appropriate message.

7
Section C [70 Marks]

Practical

Question 5 [50 Marks]


Write a C# application that will implement the sample form as shown in the picture below:

a. When the user types a file name or directory into the txtInput textbox and clicks the Display
Details button, the code should do the following:
First verifies the existence of the given file, if it exists, loads the content of the file into the
multiline textbox. It should add information on Creation time, when last modified, and when last
the file was accessed.

If the file name does not exist, the code should use appropriate try and catch syntax to take
care of the situation. The code should test if the given name is a Directory and do the same
thing as in the file case, print the added details as in the file case above. (10)

b. The user may wish to load a textfile but without any other details like creation dates and
items attached to it:
When the user types in a file name, with its directory into the txtInput, and clicks on
button ReadLines, the code should load into the output box, the textfile only. (10)
[10 marks]

c. The button clear when clicked should clear all the textboxes. (5)

d. The user may wish to create a textfile by typing desired content into the output box: When the
user types in a file name with its directory into the txtInput and clicks on button WriteFile, the
program should create the text file and save it in the provided directory. (10)

e. The user may wish to create a text file containing information captured as Name, surname and
Deposit. This should happen when the user clicks on the button WriteToFile. (10)
The program should save the above given
information, in a file name and directory, typed
into the txtInput.
f. The button Exit should close the program when clicked. (5)

Question 6 (20 Marks)

Create a console application that contains an array of 12 strings. Prompt the user to
enter a minimum string length, and use LINQ statements to display all the strings that
are at least as long as the value entered by the user. If no strings meet the criterion,
display an appropriate message.

You might also like