COMP2521 ♢ Week 01a ♢ Course Introduction ♢ (20T3)

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [0/34]
❖ People and Website

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

Course Admin Email: cs2521@unsw.edu.au

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

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

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [1/34]
❖ Course Goals

COMP1511 ...

COMP2521 ...
COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [2/34]
❖ COMP1511 vs COMP2521

COMP1511 ...

[Diagram:Pics/misc/jumping.jpg]

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [3/34]
❖ ... COMP1511 vs COMP2521

COMP2521 ...
 

[Diagram:Pics/misc/military.jpg]

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [4/34]
❖ Thinking like a Scientist

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

observe → hypothesize → experiment → analyse → repeat
COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [5/34]
❖ Course Context

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [6/34]
❖ Pre-conditions

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

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [7/34]
❖ Revision (material from COMP1511)


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

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [8/34]
❖ Post-conditions

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

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [9/34]
❖ Data Structure Viewpoint

COMP1511 considered ...

[Diagram:Pics/intro/structures0.png]

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [10/34]
❖ ... Data Structure Viewpoint

COMP2521 also considers ...

[Diagram:Pics/intro/structures.png]

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [11/34]
❖ 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 (20T3) ♢ Week 01a ♢ Course Intro ♢ [12/34]
❖ 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 (20T3) ♢ Week 01a ♢ Course Intro ♢ [13/34]
❖ Textbook

♢ Textbook is a "double-header"

       

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

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [14/34]
❖ Lectures


♢ Four scheduled hours of lectures.

♢ Lectures will contain ...


♢ But without any "background noise" :-)

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [15/34]
❖ Tutes and Labs

♢ Tutorials ...

♢ Labs ...

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

♢ Exercises for Week X available in Week X-1

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [16/34]
❖ ... Tutes and Labs

♢ Lab exercises contribute 11% to overall mark.

♢ The lab exercises for Week X must be

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

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [17/34]
❖ Assignments

♢ Two assignments ...

♢ Two assignments contribute 35% towards final mark.

♢ Late penalties apply if you miss the deadline.

♢ Good time management avoids late penalties!

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [18/34]
❖ Plagiarism

♢ Just Don't Do it

[Diagram:Pics/misc/noose1.jpg]

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

♢ 3-hour on-line exam during the exam period.

♢ How to pass?   Practice, practice, practice, ...

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [20/34]
❖ Supplementary Exams

♢ The document "Essential Advice for CSE Students" states the supplementary assessment policy for the School of CSE. Please take the time to read it carefully.

♢ If you are granted a Supplementary examination, then it will be centrally timetabled. If you think that you may be eligible for a supplementary exam, then make sure you are available on that day. It is your responsibility to check at the Student Office for details of Supplementary examinations.

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [21/34]
❖ Course Assessment

quizzes             = mark for quizzes               (out of  14)
labs                = mark for lab exercises         (out of  11)
ass1                = mark for assignment 1          (out of  15)
ass2                = mark for assignment 2          (out of  20)
finalExam           = mark for final exam            (out of  40)

okHurdle            = finalExam > 20 (that is, > 50% in the final exam)

mark      = quizzes + labs + ass1 + ass2 + finalExam
grade     = HD|DN|CR|PS  if mark >= 50 && okHurdle
          = FL           if mark <  50
          = UF           if mark >= 50 && !okHurdle
COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [22/34]
❖ Summary

♢ The goal is for you to become a better programmer

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [23/34]
❖ C vs COMP1511 vs COMP2521

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [24/34]
❖ COMP1511 Style

♢ Required use of a restricted subset of C:

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

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [25/34]
❖ COMP2521 Style

♢ Extends the range of allowed constructs:

♢ But wait! There's more ...

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [26/34]
❖ ... COMP2521 Style

♢ More allowed C constructs ...

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [27/34]
❖ ... COMP2521 Style

Good: gives you more freedom and power

Bad: gives you more freedom and power

♢ So, you must still use some discipline.

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [28/34]
❖ 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 (20T3) ♢ Week 01a ♢ Course Intro ♢ [29/34]
❖ ... 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 (20T3) ♢ Week 01a ♢ Course Intro ♢ [30/34]
❖ Exercise : Displaying Months

♢ Write a function monthName(int) that

♢ Suggest an alternative approach using an array.

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [31/34]
❖ For-loops

for encapsulates a common loop pattern:

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

as

for (init; cont; incr)
   do something;

COMP2521 (20T3) ♢ Week 01a ♢ Course Intro ♢ [32/34]
❖ ... 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 (20T3) ♢ Week 01a ♢ Course Intro ♢ [33/34]
❖ 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 (20T3) ♢ Week 01a ♢ Course Intro ♢ [34/34]


Produced: 13 Sep 2020