Professional Documents
Culture Documents
Programming 3B Individual Assignment PDF
Programming 3B Individual Assignment PDF
Qualification Title
SAQA
ID
NQF
level
Module Name
67292
Level
6
Programming
3B
Year
of
Stud
y
3rd
2nd
Individual
Assignment
DUE DATE:
10-14 October 2016
TOTAL MARKS:
100 Marks
PASS MARK:
50%
WEIGHTING:
20% towards DP mark
DEVELOPER:
NEELOFAR SHAIK
MODERATOR:
LESLEY SAMANEKA
INSTRUCTIONS TO STUDENTS:
1. Read the following instructions CAREFULLY before answering the paper.
2. Your assignment should comprise of a single word document and project
folders(practical work) per question on a disk. Your assignment should
both be typed Arial font 12, 1.5 spacing respectively.
3. Learners must include the following:
3.1 Coversheet
3.2 Contents page
3.3 Source code and screenshots of interface design and running programs.
The use of comments in your program is essential.
3.4 Glossary of terms
3.5 Bibliography, (proof of research).
4. Use the Harvard method of referencing.
5. You must consult many sources of information for adequate referencing.
6. Technical requirements for assignments:
Assignments must be presented in the correct format. Marks will be awarded in
conjunction with contents for overall presentation consisting of the following
variables: contents page, source code and running programs as well as
bibliography.
7. Ensure that your name and the name of your Campus are clearly indicated on
the cover page of your assignment.
8. Keep copies of all assignments handed in.
9. Failure to adhere to the above will result in marks being deducted.
10. No group work may be done on an Individual Assignment.
11. Plagiarism and copying of assignments will result in the default mark 0% being
awarded. This is also a punishable offence, which will lead to a disciplinary
action.
Programming 3B
Damelin
Assignment
Page 1 of 5
Individual Assignment
DECLARATION OF AUTHENTICITY
I.......................................................
Full Name & Surname
ID number
.......................
Hereby declare that the contents of this assignment are entirely my own work.
........................................................
Signature
Date
Programming 3B
Damelin
Assignment
Page 2 of 5
................
Individual Assignment
Question1
[25 Marks]
Create any simple console application for each of the exception classes listed below and use
exception handling to prevent your programs from abruptly terminating.
NB. You should have 5 programs in total.
System.ArithmeticException
System.ArrayTypeMismatchException
System.FormatException
System.IndexOutOfRangeException
System.ArgumentException
Question 2
[50 Marks]
Create an application that simulates the Monty Hall problem in which three prizes of varying value
are assigned randomly to three doors that you can implement as buttons. For example, the prizes
might be a new car or a live goat. The player chooses a button and then one of the two other prizes is
revealed; the one revealed is never the most desirable prize. The user then has the option of
changing the original selection to the remaining unseen choice. For example, consider these two
game scenarios:
Suppose the new car is randomly assigned to the first button. If the user chooses the first
button, reveal either of the other two prizes and ask the user if he wants to change his
selection.
Suppose the car is assigned to the first button, but the user chooses the second button.
Reveal the third prize so that the cars location is still hidden, and then ask the user whether
he wants to change the selection.
Programming 3B
Damelin
Assignment
Page 3 of 5
Individual Assignment
Programming 3B
Damelin
Assignment
Page 4 of 5
Individual Assignment
Question 3
[25 Marks]
Create a class named Circle with fields named radius, area, and diameter. Include a constructor that
sets the radius to 1. Also include public properties for each field.
The Radius property should have get and set accessors, but Area and Diameter should be read-only.
The set accessor for the radius should also provide values for the diameter and area. (The diameter
of a circle is twice its radius; the area is pi multiplied by the square of the radius. You can use the
public Math class property Math.PI
for the value of pi.)
Create a class named TestCircles whose Main() method declares three Circle objects. Assign a small
radius value to one Circle and assign a larger radius value to another Circle. Do not assign a value to
the radius of the third circle; instead, retain the value assigned at construction. Display the radius,
diameter, and area for each Circle. Display the area to two decimal places.
Programming 3B
Damelin
Assignment
Page 5 of 5
Individual Assignment