COMP2521 ♢ Week 01a ♢ Course Introduction ♢ (19T1)

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [0/36]
❖ People and Website

Lecturer-in-charge: Dr Ashesh Mahidadia Email: ashesh@cse.unsw.edu.au

Course Admin: Jashank Jeremy Email: jashank.jeremy@unsw.edu.au

♢ Primary entry point is WebCMS,
        Course Website is:   https://webcms3.cse.unsw.edu.au/COMP2521/19T1/

Login to WebCMS using your zID and your zPass, and is needed for

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [1/36]
❖ Course Goals

COMP1511 ...

COMP2521 ...
COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [2/36]
❖ COMP1511 vs COMP2521

COMP1511 ...

[Diagram:Pics/misc/jumping.jpg]

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [3/36]
❖ ... COMP1511 vs COMP2521

COMP2521 ...
 

[Diagram:Pics/misc/military.jpg]

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [4/36]
❖ Thinking like a Scientist

[Diagram:Pics/misc/mad-sci1.png]

observe → hypothesize → experiment → analyse → repeat
COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [5/36]
❖ Course Context

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [6/36]
❖ Pre-conditions

♢ At the start of this course you should be able to:

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [7/36]
❖ Revision (material from COMP1511)


Important: Make sure you can properly understand and effectively use the following topics (covered in COMP1511):

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [8/36]
❖ Post-conditions

♢ At the end of this course you should be able to:

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [9/36]
❖ Data Structure Viewpoint

COMP1511 considered ...

[Diagram:Pics/intro/structures0.png]

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [10/36]
❖ ... Data Structure Viewpoint

COMP2521 also considers ...

[Diagram:Pics/intro/structures.png]

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [11/36]
❖ COMP2521 Themes


♢ Major themes ...

  1. Analysis: correctness, performance, usability
  2. ADTs: sets, lists, trees, graphs, dictionaries
  3. Operations: building, sorting, searching, traversing

For data types: alternative implementation of operations

For algorithms: complexity analysis, performance analysis

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [12/36]
❖ Credits for Material

♢ Always give credit if you use someone else's work.

♢ COMP2521 material is prepared by John Shepherd, and ideas are drawn from

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [13/36]
❖ Textbook

♢ Textbook is a "double-header"

       

Good books, useful beyond COMP2521, but code style .....

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [14/36]
❖ Lectures


♢ Four scheduled hours of lectures.

♢ Lectures will contain ...


♢ But without any "background noise" :-)

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [15/36]
❖ Tutes and Labs

♢ Tutorials ...

♢ Labs ...

♢ Tutes/labs will run from week 01 to 10.

♢ Exercises for Week X available in Week X-1

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [16/36]
❖ ... Tutes and Labs

♢ Lab exercises contribute 8% to overall mark.

♢ The lab exercises for Week X must be

♢ Total mark for all the labs is greater than 8 (and they are scaled to 8).

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [17/36]
❖ Practical Midterm Exam



♢ Practical Midterm exam contribute 10% towards final mark.

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [18/36]
❖ Assignments

♢ Two assignments ...

♢ Two assignments contribute 22% towards final mark,
         subject to the conditions outlined in the section named "Course Assessment".

♢ Total marks for the assignments is greater than 22 (and they are scaled to 22).

♢ Late penalties apply if you miss the deadline.

♢ Good time management avoids late penalties!

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [19/36]
❖ Plagiarism

♢ Just Don't Do it

[Diagram:Pics/misc/noose1.jpg]

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [20/36]
❖ Final Exam

♢ 3-hour on-line 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, ...

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [21/36]
❖ Supplementary Exams

♢ Supplementary Exams are only available to students who

♢ We may also offer Supplementary Prac Exams to students who

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [22/36]
❖ Course Assessment

labs                = mark for lab exercises         (out of  8)
ass1                = mark for assignment 1          (out of  8)
ass2                = mark for assignment 2          (out of 14)
midterm	            = mark for practicalLabExams     (out of 10)
finalExam           = finalPracExam (36) + finalTheoryExam (24)          (out of 60)

okHurdle is calculated as below: okHurdle = (finalPracExam + practicalLabExams) > 24
assignmentMarks 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 = 22 * (adjusted_assPerc / 100) }
COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [23/36]
❖ ... Course Assessment

♢ In other words,

♢ For more clarification on adjusted_assPerc
(or why you should do the practical work yourself!), see the following table:

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [24/36]
❖ Summary

♢ The goal is for you to become a better programmer

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [25/36]
❖ C vs COMP1511 vs COMP2521

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [26/36]
❖ COMP1511 Style

♢ Required use of a restricted subset of C:

♢ But ... this style used in no texts or real code.

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [27/36]
❖ COMP2521 Style

♢ Extends the range of allowed constructs:

♢ But wait! There's more ...

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [28/36]
❖ ... COMP2521 Style

♢ More allowed C constructs ...

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [29/36]
❖ ... COMP2521 Style

Good: gives you more freedom and power

Bad: gives you more freedom and power

♢ So, you must still use some discipline.

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [30/36]
❖ Switch-statements

switch encapsulates a common selection:

if (v == C1) {
   S1;
} else if (v == C2) {
   S2;
}
...
else if (v == Cn) {
   Sn;
}
else {
   Sn+1;
}

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [31/36]
❖ ... Switch-statements

♢ Multi-way if becomes:

switch (v) {
case C1:
   S1; break;
case C2:
   S2; break;
...
case Cn:
   Sn; break;
default:
   Sn+1;
}

♢ Note: break is critical; if not present, falls through to next case.

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [32/36]
❖ Exercise : Displaying Months

♢ Write a function monthName(int) that

♢ Suggest an alternative approach using an array.

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [33/36]
❖ For-loops

for encapsulates a common loop pattern:

init;
while (cont) {
   do something;
   incr;
}

as

for (init; cont; incr)
   do something;

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [34/36]
❖ ... For-loops

♢ COMP1511 (while) version

sum = 0;
i = 1;
while (i < 10) {
    sum = sum + i;
    i++;
}

♢ COMP2521 (for) version

sum = 0;
for (i = 0; i < 10; i++)
    sum += i;

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [35/36]
❖ Exercise : Sequence program, using for

Write a program that prints integer sequences (one per line):

♢ Package the core part as a function:

void seq(int start, int step, int finish) {...}

main checks errors and sets up args for seq()

COMP2521 (19T1) ♢ Week 01a ♢ Course Intro ♢ [36/36]


Produced: 6 Feb 2019