2020 COS 132 Studyguide
2020 COS 132 Studyguide
Imperative Programming
COS 132
Lecturers: Ms. Tayana Morkel, Dr. Patricia Lutu and Mr Pula Rammoko
Last Revision: Version 1.0 (February 6, 2020)
c Copyright reserved
Contents
1 Introduction 3
1.1 Welcome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Educational approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Plagiarism 3
3 Administrative information 3
3.1 Online communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.1.1 CS website . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.1.2 ClickUP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.1.3 Course email address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.2 Contact details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.2.1 Lecturers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.2.2 Assistant Lecturers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.2.3 Tutors and teaching assistants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.3 Grievance procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.4 Timetables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.4.1 Lectures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.4.2 Practical lab sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4 Study material 5
4.1 Prescribed textbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4.2 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
5 Module information 6
5.1 Purpose of the module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
5.2 Articulation with other modules in the programme . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
5.3 Credits and notional hours . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
5.4 Module structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
6 Course communication 7
6.1 Announcements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
6.2 Discussion board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
6.3 Mentor sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
6.4 E-mail from students to staff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
6.5 Mark queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
7 Assessment 8
7.1 Practical Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
7.2 Self-evaluating quizzes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
7.3 Semester Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
7.4 Semester mark calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
7.5 Examination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
7.6 Final mark calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
7.7 Supplementary Examination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
8 Student support 9
9 Semester Schedule 10
2
1 Introduction
1.1 Welcome
The skill-based goal of COS132 is to introduce programming skills so that you can design and implement
solutions to software problems in the imperative programming style1 . The C++ programming language is used
as vehicle to develop these skills. If you fully assimilate the material of the course, you will have enough basic
knowledge to learn other programming languages, such as MatLab, SAS, Java and C# that you may encounter
later.
2 Plagiarism
Plagiarism is a serious form of academic misconduct. It involves both appropriating someone else’s work and
passing it off as one’s own work afterwards. Thus, you commit plagiarism when you present someone else’s
written or creative work (words, images, ideas, opinions, discoveries, artwork, music, recordings, computer-
generated work, etc.) as your own. Only hand in your own original work. Indicate precisely and accurately
when you have used information provided by someone else. Referencing must be done in accordance with a
recognised system. Indicate whether you have downloaded information from the Internet.
In programming, plagiarism includes copying someone else’s code or getting code from the Internet and
then handing it in as your own work. In this course we will be making use of an automatic plagiarism checker
to check uploaded practical assignments for plagiarism.
For more information visit www.library.up.ac.za/plagiarism/index.htm
3 Administrative information
3.1 Online communication
This course will make use of both the departmental Computer Science (CS) website as well as ClickUP.
3.1.1 CS website
This website is maintained on the web page of the Department of Computer Science. You can reach this page
by visiting the department’s website at http://www.cs.up.ac.za/, clicking the Undergraduate Portal link,
and finally clicking the COS132 link in the list. You can also reach the COS 132 module page directly, by visiting
http://www.cs.up.ac.za/courses/COS132/.
The CS website hosts the following content:
• Announcements.
• Specifications for assignments.
• Electronic submission of assignments.
• Online bookings.
• Discussion Board.
Note that you have to log in to the CS module page in order to upload assignments or make a booking. The
user-name and password for the CS module page are the same as those you use to log in to Linux, and NOT
those you use for ClickUP. The procedure for obtaining a Linux username and password will be explained in
the first COS 132 lecture.
1a programming style that describes computation in terms of statements that change a program state.
3
3.1.2 ClickUP
The ClickUP home page may be reached through the usual UP Student portal. You can reach the COS132
ClickUP page by following the COS132 link after you have logged in using the MyTUKS login at http://www.up.
ac.za/.
The ClickUP page will be used for self-evaluating quizzes, lecture slides and marks.
cos132queries@cs.up.ac.za
For any course related queries, please do not email the individual lecturers or assistants, but rather send
an email to this address.
3.4 Timetables
There are four lectures and one practical session per week for COS 132.
4
3.4.1 Lectures
Students may choose any four lectures and may mix attendance between different groups, as long as you
attend one of each (i.e. L1, L2, L3 and L4) of the lectures every week.
Students do not need to register for a specific lecture group nor will you be assigned to a specific group. You
may attend any group (or lectures from different groups) that fits best into your timetable.
Group 1 (E) Group 2 (E) Group 3 (E)
L1 Mo 10:30 Cent 5 Mo 13:30 IT 4-1 Mo 11:30 EMS 4-150
L2 Tu 7:30 Cent 4 Tu 12:30 Cent 2 Tu 10:30 EMS 4-150
L3 We 11:30 Cent 3 We 13:30 Cent 3 We 11:30 IT 4-4
L4 Th 13:30 Cent 2 Th 11:30 Cent 2 Th 8:30 IT 4-4
Lectures will not take place during Engineering Test Week and certain lectures will be cancelled during
weeks with public holidays to ensure that all groups receive the same number of lectures. Details on the
lecture schedule can be found at the end of this studyguide, in section 9.
4 Study material
4.1 Prescribed textbooks
Title: Starting Out With C++ From Control Structures through Objects
Author: Tony Gaddis
Edition: Ninth Edition - Global Edition
Publisher: Pearson
ISBN: 978-1-29-222233-2
Note that there may be other textbooks with similar titles by the same author which are NOT the same. Verify
the ISBN number to ensure that you buy the correct textbook.
4.2 Software
You are required to use Linux for programming with C++. You will need the following:
• Linux distribution – Ubuntu 18.04
• A desktop environment – XFCE
• A web browser – Firefox or Chromium
• A text editor – we recommend SciTE
• A compiler – GCC
This software is installed on the workstations in the computer labs. Guidelines about how to use the
software can be found in Chapter 6 of Tricks of the Trade for Novice Programmers Volume 1.
A virtual machine (VM) with all the required software installed with the same setup as in the labs has been
setup and is available at https://ftp.cs.up.ac.za/vms/ubuntu-vm.ova
5
5 Module information
5.1 Purpose of the module
In short, in COS 132 you will be taught how to program. You will be learning the basics of programming in
C++, but the foundation that you will learn will enable you to switch over to programming languages with ease.
Learning how to program is an important skill that forms the basis of many more advanced concepts, both in
Computer Science and other disciplines.
6
Area Study unit Topic
Programming Fundamental programming Basic syntax and semantics of C++
Fundamentals constructs Variables, types, expressions
Assignment
Simple I/O (text files)
Control structures
Functions and parameter passing
Algorithms & problem-solving Debugging strategies
Fundamental data structures Primitive types
Arrays
Records (Structs)
Strings and string processing
Advanced C++ features File Operations
Pointers
6 Course communication
There are various ways in which you can communicate with the lecturers and assistants if you need help with
the course or have general course queries.
6.1 Announcements
Announcements will appear on the CS module website. Regularly check the announcements to make sure
that you are up to date with the latest course information. The Department reserves the right to deviate from
planned schedules under unforeseen circumstances and these deviations will be communicated to you via
announcements. The announcements will probably also answer most of your course-related queries, so make
sure that you are up to date with information so that you are not later asking questions for which the answers
are already on the website.
7
7 Assessment
7.1 Practical Assignments
You will be completing practical assignments in your weekly practical session. Each practical assignment
will require you to write C++ code to solve a problem/s. Your solutions will be automatically assessed when
uploaded using a system called FitchFork. You will be allowed to make multiple submissions, however, only
the last upload before the submission deadline counts towards your marks.
There will be a total of eight practical assignments throughout the semester. The best 6 out of 8 practical
assignments will contribute to your Semester Mark. This gives you the possibility of missing 2 out of 8 practicals
without a mark penalty, thus no sick practical assignments will be given.
The preliminary schedule for practicals can be found in section 9.
Students with disabilities who need support and/or extra time should confirm special arrangements a week
before each of these tests. Send an e-mail to cos132queries@cs.up.ac.za to request arrangements.
Should you miss one of these Semester tests due to illness, you have to hand in a medical certificate at the
Computer Science reception desk within three days of the test date. Sick tests for both Semester Tests will be
arranged at the end of the semester. There will be two separate sick tests covering the scope of the original
tests and students need only write the test that they missed.
The mark allocation for each of these is discussed in more detail in their respective subsections.
7.5 Examination
A written exam will take place at the end of the module, during the scheduled exam period. The date and the
time of the examination can be found on the official UP exam timetable.
Exam entrance will only be given to students who received a semester mark of at least 30%. Students who
have a final Semester Mark of less than 30% will not be admitted to the exam and fails the course.
8
Please also take note of the examination rules, as provided for in the general rules and regulations of the
University of Pretoria, under section G.12.
Students with disabilities who need support and/or extra time should confirm special arrangements a week
before the exam. Send an e-mail to cos132queries@cs.up.ac.za to request arrangements.
If a student fails to write the exam due to illness, a valid sick note may be submitted to the EBIT Faculty
(Eng I level 6) within 3 working days after the exam to qualify for an aegrotat exam.
• To pass the course, a student must obtain at least 40% in the exam, and a final mark of at least 50%
calculated as described above.
• A student will pass the course with distinction if he/she passes the course with a final mark of at least
75%.
Note: All these mark thresholds are applied strictly. The marks of students who come close to them, but do
not actually meet them will not be adjusted.
• To pass the course, if admitted to the supplementary exam, a student must obtain at least 50% in the
supplementary exam.
• The final mark for a student who was admitted to the supplementary exam is the mark he/she obtains in
the supplementary exam.
• A maximum of 50% final mark may be awarded.
8 Student support
The University of Pretoria supports you in various ways free of charge. For academic support contact the tutors
allocated to the module (see section 3.2.3), and/or the Faculty Student Advisor.
9
• Academic support
• Goal setting and motiva-
tion
Individual consultations
• Adjustment to university
Faculty student and workshops about
life
advisors time management and
• Test or exam preparation study methods
• Stress management
• Career exploration
• Email studenthelp@up.ac.za
Safety in the evening: Green Route:
• From 18:00 till 06:00 Security Officers are available to escort you (on foot) to and from your residence or
campus anywhere east of the Hatfield campus through to the LC de Villiers terrain.
9 Semester Schedule
10
Week Lectures presented Practical Quiz Notes
3/02 – 7/02 L1, L3, L4 None None
10/02 – 14/02 L1, L2, L3, L4 Prac 1 Quiz 0
17/02 – 21/02 L1, L2, L3, L4 Prac 2 Quiz 1
24/02 – 28/03 L1, L2, L3, L4 Prac 3 Quiz 2
2/03 – 6/03 L1, L2, L3, L4 Prac 4 Quiz 3
9/03 – 13/03 No lectures None None Eng test week
14/03 Semester Test 1
16/03 – 20/03 L1, L2, L3, L4 Prac 5 Quiz 4
23/03 – 27/03 No lectures None None Recess
30/03 – 3/04 L3, L4 Prac 6 Quiz 5 30/03 & 31/03 - Recess
6/04 – 10/04 L1, L2, L3, L4 Prac 6 Quiz 5 10/04 Public Holiday
13/04 – 17/04 L2, L3, L4 Prac 7 Quiz 6 13/04 Public Holiday
20/04 – 24/04 No lectures Prac 7 None Eng test week
24/04 Semester Test 2
27/04 – 1/05 L1, L2 Prac 7 None 27/04 Public Holiday
29/04 Monday timetable
30/04 Friday timetable
1/05 Public holiday
4/05 – 8/05 L1, L2, L3, L4 Prac 8 Quiz 7
11/05 – 15/05 L1, L2, L3, L4 Prac 8 Quiz 8
18/05 – 22/05 L1, L2, L3, L4 None Quiz 9
25/05 None None None 25/05 Lectures end
11
9 Addendum A: Support services
Please download a QR code reader on your cell phone. To download a QR code reader open your
mobile app store (App Store, Google Play or Windows Marketplace) and search for QR code readers.
Student
Provides counselling and therapeutic
Counselling 012 420 2333
support to students.
Unit
Student Health Promotes and assists students with 012 420 5233
Services health and wellness. 012 420 3423
Centre for
Sexualities, Identifies and provides training of
012 420 4391
AIDS and student peer counsellors.
Gender
12