Week 01
COMP2521 17s2 ... Computing 2 | 1/36 |
ashesh@cse.unsw.edu.au
Course Goals | 2/36 |
COMP1511 ...
COMP1511 vs COMP2521 | 3/36 |
COMP1511 ...
... COMP1511 vs COMP2521 | 4/36 |
COMP2521 ...
Thinking like a Scientist | 5/36 |
Course Context | 6/36 |
Pre-conditions | 7/36 |
At the start of this course you should be able to:
char
int
float
if
while
Post-conditions | 8/36 |
At the end of this course you should be able to:
Data Structure Viewpoint | 9/36 |
COMP1511 considered ...
... Data Structure Viewpoint | 10/36 |
COMP2521 also considers ...
COMP2521 Themes | 11/36 |
Major themes ...
For algorithms: complexity analysis, performance analysis
COMP2521 on the Web | 12/36 |
Primary entry point is WebCMS
http://webcms3.cse.unsw.edu.au/COMP2521/17s2/
... COMP2521 on the Web | 13/36 |
Most material on WebCMS is publically readable.
Login to WebCMS is via zID/zPass, and is needed for
Submit work via give
Check marks via sturec
Credits for Material | 14/36 |
Always give credit if you use someone else's work.
COMP2521 material is prepared by John Shepherd, and ideas are drawn from
Textbook | 15/36 |
Textbook is a "double-header"
Good books, useful beyond COMP2521, but code style .....
Lectures | 16/36 |
Three scheduled hours: Tuesday 10-11am, Wednesday 10-12noon
Lectures will contain ...
But without any "background noise".
Tutes and Labs | 17/36 |
Tutorials ...
Labs ...
Tutes/labs run weeks 2 to 13
Exercises for Week X available in Week X-1
... Tutes and Labs | 18/36 |
Lab exercises contribute 5% to overall mark.
The lab exercises for Week X must be
Total mark for all the labs is greater than 5 (and they are scaled to 5).
Practical Lab Exams | 19/36 |
Two practical lab exams ...
Two practical lab exams contribute 12% towards final mark. Total mark for all the practical lab exams is greater than 12 (and they are scaled to 12).
Assignments | 20/36 |
Two assignments ...
Two assignments contribute 23% towards final mark, subject to the conditions outlined in the section named "Course Assessment".
Total mark for the assignments is greater than 23 (and they are scaled to 23).
Late penalties apply if you miss the deadline.
Good time management avoids late penalties!
Plagiarism | 21/36 |
Final Exam | 22/36 |
3-hour on-line torture exam during the exam period.
Held in CSE labs (must know lab environment)
On-line documentation available in exam:
Format:
How to pass? Practice, practice, practice, ...
Supplementary Exams | 23/36 |
Supplementary Exams are only available to students who
We may also offer Supplementary Prac Exams to students who
Course Assessment | 24/36 |
labs = mark for lab exercises (out of 5) ass1 = mark for assignment 1 (out of 9) ass2 = mark for assignment 2 (out of 14) practicalLabExams = mark for practicalLabExams (out of 12) finalExam = finalPracExam (36) + finalTheoryExam (24) (out of 60) mark = labs + assignmentMarks + practicalLabExams + finalExam grade = HD|DN|CR|PS if mark >= 50 && okALL = FL if mark < 50 = UF if mark >= 50 && !okALLokALL is calculated as below: okPracticalLabExams = (practicalLabExams >= 8/12) okFinalPracExam = (finalPracExam > 18/36 ) okALL = okPracticalLabExams && okFinalPracExamassignmentMarks is calculated as below: assignmentMarks = ass1 + ass2 assPerc = assignmentMarks in percentages (out of 100) pracExamPerc = finalPracExam in percentages (out of 100) if( assPerc > pracExamPerc ) { // harmonic mean of assPerc and pracExamPerc adjusted_assPerc = (2 * assPerc * pracExamPerc) / (assPerc + pracExamPerc) assignmentMarks = 23 * (adjusted_assPerc / 100) }
In other words, if you don't learn how to program by doing the prac work yourself, you'll score poorly in the finalPracExam, resulting in reduced assignment marks and making it very difficult for you to pass the course.
For more clarification on adjusted_assPerc (or why you should do the prac work yourself!), see the following table:
.
Summary | 25/36 |
The goal is for you to become a better programmer
C vs COMP1511 vs COMP2521 |
COMP1511 Style | 27/36 |
Required use of a restricted subset of C:
if
while
COMP2521 Style | 28/36 |
Extends the range of allowed constructs:
if
switch
while
for
break
continue
... COMP2521 Style | 29/36 |
More allowed C constructs ...
x = c ? e1 : e2
return
... COMP2521 Style | 30/36 |
Good: gives you more freedom and power
Bad: gives you more freedom and power
Switch-statements | 31/36 |
switch
if (v == C1) { S1; } else if (v == C2) { S2; } ... else if (v == Cn) { Sn; } else { Sn+1; }
... Switch-statements | 32/36 |
Multi-way if
switch (v) { case C1: S1; break; case C2: S2; break; ... case Cn: Sn; break; default: Sn+1; }
Note: break
Exercise 1: Displaying Months | 33/36 |
Write a function monthName(int)
switch
For-loops | 34/36 |
for
init; while (cont) { do something; incr; }
as
for (init; cont; incr) do something;
... For-loops | 35/36 |
COMP1511 (while
sum = 0; i = 1; while (i < 10) { sum = sum + i; i++; }
COMP2521 (for
sum = 0; for (i = 0; i < 10; i++) sum += i;
Exercise 2: Sequence program, using for | 36/36 |
Write a program that prints integer sequences (one per line):
seqq 10
1 2 3 4 5 6 7 8 9 10
seqq 5 10
5 6 7 8 9 10
seqq 10 1
10 9 8 7 6 5 4 3 2 1
seqq 1 3 10
1 4 7 10
seqq 1 3 11
1 4 7 10
seqq -3
1 0 -1 -2 -3
seqq 1 -3 10
void seq(int start, int step, int finish) {...}
main
seq()
Produced: 24 Jul 2017