Sei sulla pagina 1di 9

CompSci

101 - Principles of Programming 2

Learning outcomes
!At the end of this lecture, students should be able to:
! understand where to obtain informa.on about CompSci 101
! understand which parts of the CompSci 101 assessment contribute to the prac.cal mark
WELCOME TO ! understand which parts of the CompSci 101 assessment contribute to the theory mark
! understand that to pass CompSci 101, both the prac.cal part of the course and the
COMPSCI 1 1 theory part of the course need to be passed

Principles of Programming ! understand an algorithm


Lecture 1 - Introduc.on

CompSci 101 - Principles of Programming 3 CompSci 101 - Principles of Programming 4

We are using Canvas The CompSci 101 website


!CompSci 101 has a course website: !The CompSci 101 website can be reached by logging onto the
Canvas website: h.ps://canvas.auckland.ac.nz
h.ps://www.cs.auckland.ac.nz/courses/compsci101ssc/
OR by going directly to the CompSci 101 website:
h.ps://www.cs.auckland.ac.nz/courses/compsci101ssc/
!We will be using the Canvas Learning Management system this
! Here you will nd all the informa.on about our course set up.
semester. All the material on the CompSci 101 website can be
! Get used to looking at this website for informa.on about lecture slides, lab
accessed through Canvas: documents, assignment resources, assessment, people involved in the course
and lots more.
h.ps://canvas.auckland.ac.nz
CompSci 101 - Principles of Programming 5 CompSci 101 - Principles of Programming 6

People in this course People in this course

Ann Cameron (Lab Supervisor) Adriana Ferraro (Coordinator)


Email: ann@cs.auckland.ac.nz Email: adriana@cs.auckland.ac.nz
Phone: 9234947 Phone: 9237113
Room: 303S.479 Room: 303S.490


CompSci 101 - Principles of Programming 7 CompSci 101 - Principles of Programming 8

Oce Hours Lecture schedule


! Open door policy Visit any .me ! On the course informa.on sheet there is a schedule of the lectures
for CompSci 101.
h.ps://www.cs.auckland.ac.nz/courses/compsci101ssc/info/CourseInformaGon.pdf


CompSci 101 - Principles of Programming 9 CompSci 101 - Principles of Programming 10

Lecture Slides CompSci 101 Lecture Slide Exercises


!Lecture slides will be available on the web before each lecture. !There is no textbook but we do have a booklet of the skeleton
examples from the lecture slides:
CompSci 101
h.ps://www.cs.auckland.ac.nz/courses/compsci101ssc/lectures Exercises From The Lecture Slides

This booklet is available


NOW from the UBS
University Bookshop
($13.50).

CompSci 101 - Principles of Programming 11 CompSci 101 - Principles of Programming 12

There is no textbook for CompSci 101 Labs


!There is no textbook but we do have an online reference book, !Labs start next week: Monday January 9/Tuesday January 10

Think Python How to think like a computer scienGst. ! You must abend two 2 hour tutorial lab sessions each week. One will be on Monday or
Tuesday and the other on Thursday or Friday. You will have enrolled in 2 lab .mes. Your
h.ps://www.cs.auckland.ac.nz/courses/compsci101ssc/resources/
Monday/Tuesday lab .me is labelled Lab on Student Services Online, and your Thursday/
! Please be aware that we are teaching the CompSci 101 material in a dierent order to Friday lab is labelled Tut. You should abend the same lab .mes each week.
the ordering in this book. This book is a reference book, not a textbook for this course. ! Labs are held in room 279 (Building 303S) which is on the second oor of the
Computer Science building.

h.ps://www.cs.auckland.ac.nz/courses/compsci101ssc/labs/

CompSci 101 - Principles of Programming 13 CompSci 101 - Principles of Programming 14

More about labs Before the rst lab


!Labs start next week: Monday January 9/Tuesday January 10 !Visit the lab tomorrow ager the lecture.
! Before the rst lab you need to complete the lab prepara.on sheet (I will hand this out).
!There are 9 labs and each lab is worth 1% of your nal mark. ! In order to ll the sheet you need to visit the CompSci 101 lab. Immediately ager the
lecture tomorrow I will be taking people across to the CompSci 101 lab.
! At your lab .me you will be given programming problems to solve within the 2 hours for
your lab.


h.ps://www.cs.auckland.ac.nz/courses/compsci101ssc/labs/

CompSci 101 - Principles of Programming 15 CompSci 101 - Principles of Programming 16

Assignments Assignments
!The assignments are worth 11% of your nal mark. !There are 5 assignments in total worth 11% of your nal mark.
!Assignments give you the experience of solving problems on your
own. !For three of these ve assignments (7% of your nal mark), you are
!Never share your code. required to write and submit one or more programs.

!All assignments are due at 4:30pm on the due date.


!Three of the ve assignments are handed in using the

Assignment Drop Box:
Solve the problem on your own
discuss the assignment with
others but never share code.

h.ps://adb.auckland.ac.nz/Home/

h.ps://www.cs.auckland.ac.nz/courses/compsci101ssc/assignments/
CompSci 101 - Principles of Programming 17 CompSci 101 - Principles of Programming 18

Assignments - CodeRunner Plagiarism


!There are 5 assignments in total worth 11% of your nal mark.
!For two of these ve assignments (a total of 4%), you are required Plagiarism


to use CodeRunner. Plagiarism: Any work that you take credit for, but
which is done by someone else. This is treated very
seriously in an academic environment.
!The CodeRunner tool is designed to help you prac.se by presen.ng
you with a set of coding and other exercises. Students can work
with on-line exercises using the Moodle learning system.

h.ps://www.coderunner.auckland.ac.nz/moodle/

!All assignments are due at 4:30pm on the due date.


!Informa.on about using CodeRunner is available on CompSci 101


assignments web page:

h.ps://www.cs.auckland.ac.nz/courses/compsci101ssc/assignments/ h.ps://www.academicintegrity.auckland.ac.nz

CompSci 101 - Principles of Programming 19 CompSci 101 - Principles of Programming 20

Academic Integrity Test


!The test is worth 15% of your nal mark
!The test date and .me is:

Wednesday 25th January 9:15am - 10:30am

Email Adriana Ferraro (adriana@cs.auckland.ac.nz), the CompSci


101 course coordinator, if you are unable to abend the test
!The test is 75 minutes long plus 5 minutes of reading .me. Arrive at
9:05 because your reading .me starts at 9:10am.

!More about this closer to the .me.



h.ps://www.academicintegrity.auckland.ac.nz
CompSci 101 - Principles of Programming 21 CompSci 101 - Principles of Programming 22

Exam Passing CompSci 101


!The exam is worth 65% of your nal mark.


Assessment


PRACTICAL THEORY
Labs 9% Test 15%
Assignments 11% Exam 65%

To pass the course


you MUST pass the PRACTICAL (i.e. get 10 / 20 or more)
you MUST pass the THEORY (i.e. get 40 / 80 or more)
h.ps://www.auckland.ac.nz/en/students/academic-informaGon/
exams-and-nal-results/during-exams.html

CompSci 101 - Principles of Programming 23 CompSci 101 - Principles of Programming 24

The CompSci 101 website Canvas


!Most of the resources you will need (e.g., lecture slides, lab !On Canvas you will nd:
material, assignments, course informa.on) can be found on the your marks
CompSci 101 website: class announcements
h.ps://www.cs.auckland.ac.nz/courses/compsci101ssc/ lecture recordings
links to the CompSci 101 website

h.ps://canvas.auckland.ac.nz
CompSci 101 - Principles of Programming 25 CompSci 101 - Principles of Programming 26

Compu.ng resources Learning outcomes for CompSci 101


! determine the state of the program both during and ager execu.on,
Undergraduate Labs: given a code lis.ng that may include func.ons and parameters,
There are demonstrators in these labs
loops, condi.onals and sequences,
to help you ! implement a given algorithm using Python,
! show that a program meets given specica.ons by wri.ng
appropriate tests,
! provide a useful level of documenta.on, in the form of program
GCL (room 091) Ground comments, for all programs developed,
Floor Computer Lab ! decompose a simple problem into several smaller tasks,

This is a quiet lab


! given a brief textual descrip.on of the problem,
! compose func.ons that perform a specied task into a program that
solves a given problem,
! describe program design and syntax using wriben language,

CompSci 101 - Principles of Programming CompSci 101 - Principles of Programming 28

Algorithms HOW TO GET


TO UNI
Algorithms what kind of steps?
! A nite set of steps that specify a sequence of opera.ons to be An algorithm is a well-dened, unambiguous
carried out in order to solve a specic problem.
sequence of steps

! A beber deni.on:
An algorithm is a Walk to the bus stop at the shops up the road
sequenGal
well-dened, operaGons
Get on bus number "101"
unambiguous
sequence of steps

Pay the bus driver $4.50

Get o at the Symonds St bus stop

Walk 200m to the Computer Science building

27
CompSci 101 - Principles of Programming 29 CompSci 101 - Principles of Programming 30

HOW TO Algorithms what kind of steps? HOW TO PAY Algorithms what kind of steps?
WALK TO THE THE BUS
BUS STOP FARE
An algorithm is a well-dened, unambiguous An algorithm is a well-dened, unambiguous
sequence of steps sequence of steps

iteraGve
condiGonal Open the front door operaGons Open wallet
operaGons

[ [
IF it is raining THEN WHILE you s.ll haven't paid enough
take an umbrella give the driver another coin

Walk down the driveway and turn leg Take a seat

Walk 50m down the street

CompSci 101 - Principles of Programming 31 CompSci 101 - Principles of Programming 32

Basic programming steps Programming - Step 2 - write the code

!We will use the Python programming language to implement


our algorithms
! TASK
1 design ALGORITHM

ALGORITHM

2 coding
2 coding

CODE
3 tes0ng Python
CODE
PROGRAM
CompSci 101 - Principles of Programming 33 CompSci 101 - Principles of Programming 34

Hangman algorithm
********************
- - -
TicTacToe
Computer move
- - -
Enter a letter: d! ********************
- - -
+---+ ! X - O

********************
O X X
| | !

0 | ! X enter your move? (1-9): 5 X O O


/|\ | ! ******************** ********************

/ \ | ! - - -
| ! X enter your move? (1-9): 2
- X -
========= ! ********************
+---+ ! - - -
! X X O
| | ! ********************
| ! Word: l a _ _ b o n e s ! O X X
| ! ! Computer move X O O
| ! Letters Missed: r m k c u d ! ******************** ********************
| ! Letters Guessed: a e s n o l b ! - - O

Computer move
Letters Available: fghijpqtvwxyz! - X -
========= ! ********************
! - - -
! X X O
Word: _ _ _ _ _ _ _ _ _ ! ! ********************
O X X
Sorry, you have lost in the game of !
! X enter your next move? (1-9): 1 X O O
Letters Missed: ! Hangman...! ********************
The word was lazybones!
...
Letters Guessed: !
Letters Available: abcdefghijklmnopqrstuvwxyz! The result is a draw.!
Enter a letter: a!
!

Potrebbero piacerti anche