compsci 101 s1 2015 principles of programming lecture 1 – introduction

31
COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

Upload: ophelia-sutton

Post on 25-Dec-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

COMPSCI 101 S1 2015 Principles of Programming

Lecture 1 – Introduction

Page 2: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 1012

Learning outcomes At the end of this lecture, students should be able

to: understand where to obtain information about

CompSci 101 understand which parts of the CompSci 101

assessment contribute to the practical mark understand which parts of the CompSci 101

assessment contribute to the theory mark understand that to pass CompSci 101, both the

practical part of the course and the theory part of the course need to be passed

understand an algorithm

Page 3: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 1013

The CompSci 101 website This is the address of the CompSci 101 website

Here you will find all the information about our course set up

Get used to looking at this website for information about lecture slides, lab documents, assignment resources, assessment, people involved in the course and lots more.

https://www.cs.auckland.ac.nz/courses/compsci101s1c/

Course Information Document

LabsAssignments

Forums

LecturesPeople

Tests, Exams

Page 4: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 1014

People in this course

Ann Cameron (Lab Supervisor) Email: [email protected]: 373-7599 ext 84947Room: 303S.479

Page 5: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 1015

People in this course Angela Chang (Course Coordinator)

Email: [email protected] Phone: 373-7599 ext 86620 Room: 303S.494 Office Hours: Open door policy – Visit any time

Adriana Ferraro Email: [email protected] Phone: 373-7599 ext 87113 Room: 303S.490

Dr Jing Sun Email: [email protected] Phone: 373-7599 ext 82286 Room: 303S.481

Page 6: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 1016

Lecture schedule On the course information sheet there is a schedule of the lectures for CompSci 101.

Course Information

Document

Page 7: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 1017

Lecture Slides Lecture slides will be available on the web before each

lecture.

https://www.cs.auckland.ac.nz/courses/compsci101s1c/lectures

Lectures

Page 8: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 1018

There is no textbook for CompSci 101 No textbook but we do have an online reference book, Think

Python – How to think like a computer scientist. Please be aware that we are teaching the CompSci 101 material in a

different order to the ordering in this book. This book is a reference book, not a textbook for this course.

https://www.cs.auckland.ac.nz/courses/compsci101s1c/resources/

Resources

Page 9: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 1019

Labs start in the second week Labs are held in room 279 (Building 303S) which is on

the second floor of the Computer Science building. There are 9 labs and worth 9% of your final mark. At your lab time you will be given programming

problems to solve within the 2 hours for your lab.

More about labs

https://www.cs.auckland.ac.nz/courses/compsci101s1c/labs/

Labs

Page 10: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10110

Before the first lab Visit the lab on Friday between 11am and 12:30pm.

Before the first lab you need to complete the lab preparation sheet (I will hand this out).

In order to fill the sheet you need to visit the CompSci 101 lab on Friday.

Page 11: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10111

Assignments The assignments are worth 9% of your final

mark. Assignments give you the experience of solving

problems on your own. Never share your code.

Solve the problem on your own – discuss the

assignment with others but never share code.

https://www.cs.auckland.ac.nz/courses/compsci101s1c/assignments/

Assignments

Page 12: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10112

Assignments There are 4 assignments.

All assignments are due at 4:30pm on the due date. The assignments are handed in using the

Assignment Drop Box:

https://adb.auckland.ac.nz/Home/

Page 13: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10113

Code Runner Exercises There are 3 Code Runner Exercises and are worth

7% of your final mark. All exercises are due at 4:30pm on the due date. Exercises are to be completed using the Code

Runner System:

https://www.coderunner.auckland.ac.nz/

Page 14: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10114

Plagiarism

https://www.auckland.ac.nz/en/about/teaching-learning/academic-integrity.html

Plagiarism: Any work that you take credit for, but which is done by someone else. This is treated very seriously in an academic environment.

Plagiarism

Page 15: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10115

Academic Integrity

https://www.auckland.ac.nz/en/about/teaching-learning/academic-integrity.html

Page 16: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10116

Test The test is worth 15% of your final mark

The test date and time is: Tuesday 5th May 6:30pm - 7:45pm

The test is 75 minutes long plus 5 minutes of reading time. Arrive at 6:20 because your reading time starts at 6:25pm.

More about this closer to the time.

Email Angela Chang([email protected]), the CompSci 101 course coordinator, if you are unable to attend the test

Page 17: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10117

Exam The exam is worth 60% of your final mark.

https://www.auckland.ac.nz/en/for/current-students/cs-academic-information/cs-examination-information.html

Links to information about missed exams, aegrotats, etc.

Page 18: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10118

Passing CompSci 101

PRACTICAL THEORYTest 15%Exam 60%

Labs 9%Code Runner 7%Assignments 9%

To pass the course

you MUST pass the PRACTICAL (i.e. get 12.5 / 25)you MUST pass the THEORY (i.e. get 37.5 / 75)

Assessment

Page 19: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10119

The CompSci 101 website Most of the resources you will need (e.g., lecture

slides, lab material, assignments, course information) can be found on the CompSci 101 website:

https://www.cs.auckland.ac.nz/courses/compsci101s1c/

Course Information Document

Labs

Assignments

Forums

LecturesPeople

Tests, Exams

Page 20: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10120

Cecil On Cecil you will find:

your marks class announcements lecture recordings

http://cecil.auckland.ac.nz

Page 21: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10121

Computing resourcesUndergraduate Labs: There are demonstrators in these labs to help you

This is a quiet lab

GCL (room 091) – Ground Floor Computer Lab

Page 22: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10122

Learning outcomes for CompSci 101 determine the state of the program both during and after

execution, given a code listing that may include functions and parameters, loops, conditionals and sequences,

implement a given algorithm using Python, show that a program meets given specifications by writing

appropriate tests, provide a useful level of documentation, in the form of

program comments, for all programs developed, decompose a simple problem into several smaller tasks, given a brief textual description of the problem, compose functions that perform a specified task into a

program that solves a given problem, describe program design and syntax using written

language,

Page 23: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10123

Algorithms A finite set of steps that specify a sequence of operations to be

carried out in order to solve a specific problem.

A better definition:

An algorithm is a well-defined, unambiguous

sequence of steps

Page 24: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10124

HOW TO GET TO

UNI

Algorithms – what kind of steps?

Walk to the bus stop at the shops up the road

Get on bus number "101"

Pay the bus driver $3.50

Get off at the Symonds St bus stop

Walk 200m to the Computer Science building

sequential

operations

An algorithm is a well-defined, unambiguous sequence of steps

Page 25: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10125

Algorithms – what kind of steps?

Open the front door

IF it is raining THEN

take an umbrella

Walk down the driveway and turn left

Walk 50m down the street

An algorithm is a well-defined, unambiguous sequence of steps

conditional

operations

HOW TO WALK TO THE BUS

STOP

Page 26: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10126

Algorithms – what kind of steps?

Open wallet

WHILE you still haven't paid enough

give the driver another coin

Take a seat

An algorithm is a well-defined, unambiguous sequence of steps

iterative

operations

HOW TO PAY THE

BUS FARE

Page 27: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10127

Basic programming steps

TASK

ALGORITHM1 design

2 coding

3 testing

CODE

PROGRAM

Page 28: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10128

Programming - Step 2 - write the code We will use the Python programming language to

implement our algorithms

ALGORITHM

2 coding

PythonCODE

Page 29: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10129

Hangman

+---+ | | | | | | =========

Word: _ _ _ _ _ _ _ _ _

Letters Missed: Letters Guessed: Letters Available: abcdefghijklmnopqrstuvwxyzEnter a letter: a

Enter a letter: d +---+ | | 0 | /|\ | / \ | | =========

Word: l a _ _ b o n e s

Letters Missed: r m k c u d Letters Guessed: a e s n o l b Letters Available: fghijpqtvwxyz

Sorry, you have lost in the game of Hangman...

The word was lazybones

Page 30: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10130

Welcome to Tic Tac Toe!Do you want to be X or O: XThe computer will go first.

| | | | O | | ----------- | | | | | | ----------- | | | | | |

What is your next move? (1-9): 5

TicTacToe

What is your next move? (1-9): 6

| | O | X | O | | ----------- | | O | X | X | | ----------- | | X | O | O | |

The game is a tie!Do you want to play again?

(yes or no): n

Page 31: COMPSCI 101 S1 2015 Principles of Programming Lecture 1 – Introduction

CompSci 10131

What you need to do this week… Go to our course website:

https://www.cs.auckland.ac.nz/courses/compsci101s1c/resources/

Download and Install Python (Version 3.x): 3.3 or 3.4 https://www.python.org/download/releases/3.3.4/

Download and Install Notepad++ http://notepad-plus-plus.org/

Set up Notepad++ to run Python programs https://www.cs.auckland.ac.nz/courses/compsci101s1c/resources/SetUpNote

Pad++.pdf

Download Python reference book: Think Python https://

www.cs.auckland.ac.nz/courses/compsci101s1c/resources/thinkpython.pdf

Add a command:Macro -> Run Python