lOMoAR cPSD| 5946946
COS1512 Introduction to programming II
with Complete Solutions 2023/2024
.(University of South Africa)
, lOMoAR cPSD| 5946946
Introduction to Programming II
COS1512
Semester 2
School of Computing
This tutorial letter contains the
solution to Assignment 2
IMPORTANT INFORMATION:
Please activate your myUnisa and myLife email addresses and ensure you have
regular access to the myUnisa module site COS1512-2018-S2 as well as your e-
tutor group site.
Due to regulatory requirements imposed by the Department of National Education
the following apply:
To be considered for examination admission in COS1512, a student must meet
the following requirement:
Submit assignment 1 or assignment 2
Note: This is a blended online module, and therefore your module is available on myUnisa.
However, in order to support you in your learning process, you will also receive some study
materials in printed format. Please visit the COS1512 course website on myUnisa at least
twice a week.
, lOMoAR cPSD| 5946946
2
Content
1. Introduction .................................................................................................................................... 2
2. Tutorial matter distributed to date................................................................................................... 2
3. Allocation of marks ........................................................................................................................ 3
4. Solution to Assignment .................................................................................................................. 2
1. Introduction
The purpose of this tutorial letter is to supply the solution for Assignment 2, and to indicate how you should
interpret the results you obtained for this assignment. This assignment covers the work discussed in
Chapters 10, 11 and 12 of the Study Guide (Tutorial Letter 102), as well as the relevant sections in
Chapters 10, 11 and 12, and Appendices 7 and 8 of Savitch. Note that you should have included the input
and output of all programs you were required to write.
The assessment and feedback given on your assignment, serve as an indication of your mastering of the
study material.
If you received a good mark, you can be confident that you are on the right track. If you did not receive a
good mark, it is an indication that you need to revise your study method for COS1512.
2. Tutorial matter distributed to date
DISK 2018 Prescribed software
COS1512/101/3/2018 First tutorial letter: General information, study programme, exam admission
and assignments
COS1512/102/3/2018 Study Guide
COS1512/103/3/2018 How to create an assignment as a PDF file
COS1512/201/2/2018 Solution to Assignment 1
COS1512/104/2/2018 Exam Tutorial Letter
COS1512/202/2/2018 This letter: Solution to Assignment 2
If you have not received all of the above-mentioned tutorial matter, please download it from myUnisa at
https://my.unisa.ac.za.
, lOMoAR cPSD| 5946946
3
3. Allocation of marks
When we mark assignments, we comment on your answers. Many students make the same mistakes and
consequently we discuss general problems in the tutorial letters. It is, therefore, important to work through
the tutorial letters and to make sure you understand our solutions and where you went wrong.
The maximum number of marks you could obtain for Assignment 2 is 55. This is converted to a
percentage. If you for instance obtained 30 marks for Assignment 2, you received 55% for Assignment
2. This percentage in turn contributes a weight of 80% to the year mark, as can be seen in the
summary of the weights allocated to the assignments for COS1512 below.
Assignment Weight
number
1 20
2 80
3 0
Questions 2, 4 and 6 have not been marked. However, 5 marks are awarded if you attempted questions 2,
4 and 6. Please note that this is NOT the way exam answers will be marked. In the exam you will
receive marks for specific statements as indicated by the exam question. The purpose of the assignments
is to provide you with an opportunity to practice the concepts you are studying. Your marks for the
assignment is an indication of whether or not you could implement those concepts. We include complete
solutions for all questions.
The marks you received for question 1 were determined on the following basis:
Question not done 0/5
Question attempted, but the program does not work at all 1/5
A good attempt, but there are a few problems with your answer 3/5
The program works correctly and produces the correct output 5/5
The marks you received for question 3 are indicated by ticks (√) in the solution.
The marks you received for questions 5 and 7 was determined on the following basis:
Question not done 0/15
Question attempted, but the program does not work at all 5/15
A good attempt, but there are a few problems with your answer 10/15
The program works correctly and produces the correct output 15/15
In other words, you can obtain a maximum of 5 marks for questions 1, 2, 3, 4 and 6; and a maximum of 15
marks for questions 5 and 7.
Note that not all mistakes are corrected – but we will provide informative comments.
If you did not include the program output for questions 1, it means there are “a few problems with your
answer” and the maximum you can get is then 3/5. If you did not include the program output for questions
5 and 7, it means there are “a few problems with your answer” and the maximum you can get is then 10/15.
We did not award any marks to assignments submitted more than four weeks after the due date.
However, we still provided informative comments.