CS 105: INTRO TO COMPUTING, NON-TECHNICAL Max Fowler (Computer - - PowerPoint PPT Presentation

cs 105 intro to computing
SMART_READER_LITE
LIVE PREVIEW

CS 105: INTRO TO COMPUTING, NON-TECHNICAL Max Fowler (Computer - - PowerPoint PPT Presentation

CS 105: INTRO TO COMPUTING, NON-TECHNICAL Max Fowler (Computer Science) https://pages.github-dev.cs.illinois.edu/cs-105/web/ June 14, 2020 Video Series One Topics What are the goals of this course (and why care?) A few notes about the


slide-1
SLIDE 1

CS 105: INTRO TO COMPUTING, NON-TECHNICAL

Max Fowler (Computer Science) https://pages.github-dev.cs.illinois.edu/cs-105/web/

June 14, 2020

slide-2
SLIDE 2

Video Series One Topics

 What are the goals of this course (and why care?)  A few notes about the course  Computer and Programming Language Basics  Types and Type Conversion  Input vs Print

slide-3
SLIDE 3

Goals

slide-4
SLIDE 4

What is Computer Science, anyways?

“Computers are to Computer Science what telescopes are to astronomy” – Edsger Dijkstra

 CS is concerned with understanding…

 What is computable  How to [specify computation, perform computation, communicate between

computers] in the [fastest, most reliable, most secure, cheapest/lowest resource] way

 How to help humans solve problems with computers

slide-5
SLIDE 5

What are the course's learning objectives?

1.

Given a small (5-10 line) Python program, students should be able to execute the program in their head and correctly predict the outcome.

2.

Given a small (5-10 line) Python function, students should be able to provide a natural language description of what the function does.

3.

Students should be able to write short (5-10 line) Python programs, including the use of variables, expressions, conditionals, loops, and functions.

4.

Students should be able to use built-in Python data structures including strings, lists, and dictionaries.

5.

Students should be aware of intermediate programming concepts including modules, exception handling, user-defined types (classes)

6.

Students should be capable of using basic and intermediate spreadsheet

  • perations (including INDEX, MATCH, and VLOOKUP), writing simple HTML

documents, and performing simple data analysis tasks.

slide-6
SLIDE 6

What is "Programming?"

 A series of instructions that

can be carried out by a computer

 A startlingly useful skill  A skill that is useful even to

be "aware" of

http://www.programmingbasics.org/en/beginner/img/commands4.png

slide-7
SLIDE 7

Other terms for Programs

Programs Software Applications Code But not "codes"!!

https://www.geeksforgeeks.org/caesar-cipher-in-cryptography/ https://twitter.com/m4tt/status/1138029336198561792

slide-8
SLIDE 8

Programs do many things

slide-9
SLIDE 9

Three parts of a program

 Algorithms

 A step-by-step process for achieving a result  Often written in pseudo-code

 Ignore details  Increase generality

 Programming

 Express the commands in a form the computer understands

 Testing and Debugging

 Make sure the program works  And works correctly  Every time you run it

slide-10
SLIDE 10

Why do we need programming languages?

 "I saw the man in the park with the telescope"  Who had the telescope?  Who was in the park?  "With my telescope, I saw a man standing in a park…"  "I saw a man with a telescope standing across the street in the park…"  "While I was in the park with my telescope, I saw the man…"

slide-11
SLIDE 11

Programming languages -> exact and unambiguous

 Everything has a precise FORM (syntax) and precise

MEANING (semantics)

 Syntax: Rules of what are acceptable programs  Semantics: Rules specifying WHAT a program does

slide-12
SLIDE 12

This is all are largely arbitrary

 Humans and programming languages are human made  If you haven't seen this before, there isn't any reason why

you should know any of it right away

 Easiest bugs to find? The ones you've made before

No shortcut around mistakes Even experts make mistakes…

slide-13
SLIDE 13

Video Question – what is an algorithm?

slide-14
SLIDE 14

Notes about the course

slide-15
SLIDE 15

Do…

Give the course website a read – particularly the

syllabus and announcements!

Sign up for Piazza, get access to Prairie Learn, buy

the book, etc. -> details in the first announcement

Check the course calendar – the due dates are

already up for the summer!

slide-16
SLIDE 16

What is known about teaching and learning

 No one can pay attention for 90 continuous minutes Video snippets, rather than "a video" or "two videos" Attention span? About 10-15 minutes Watch with some focus  "Time on task" is a primary factor of how much gets learned The course is intended to give you productive things to do  Doing is better for learning than reading or listening Expending mental energy enables things to "stick"

slide-17
SLIDE 17

What is known about teaching and learning

 You can most efficiently learn… Things related to what you know Things that are only slightly harder than the things you can already do  Long term retention comes from repeated, distributed practice Best retention – a cycle of forgetting and re-learning Best spaced in time: cramming will not produce long term retention

slide-18
SLIDE 18

What is the homework policy in CS 105?

Learning benefits from collaboration… The extreme end – hire a stranger to tell you what

to type into homework

slide-19
SLIDE 19

Formative vs Summative Assessment

 Practice/Formative Assessment

Intended for learning, self-evaluation In 105, this is the homework, reading activities, and labs You may get help from ANYONE – but you need to type your answer

 Summative Assessment

Evaluate how much has been learned In 105 – The quizzes and the final Has to be done by yourself (with limited materials)

slide-20
SLIDE 20

What are the quizzes and exams?

 7 quizzes using the Computer-Based Testing Facility's

  • nline proctoring (every Monday from 6/22 onward)

Sign-up with CBTF proctoring

https://cbtf.engr.illinois.edu/sched

50 minutes

 The final – one three hour "mega quiz" (although not

strictly "three times" as large), time TBD

slide-21
SLIDE 21

Video Question – what is the homework policy?

slide-22
SLIDE 22

Computer & Programming Language Basics

slide-23
SLIDE 23

The major parts

slide-24
SLIDE 24

Computers…

How many instructions a second can computers

execute?

Hundreds? Thousands? Millions? GHz – billions of things a second!

Are computers "smart"?

No, they're dumb – and do exactly what you tell

them to do

slide-25
SLIDE 25

Computers are dumb

 On a "Linux" system  rm –rf / removes everything

in "root", the / directory

 Imagine deleting everything

  • n your machine and not

having an undo button…

https://jerrygamblin.com/2016/10/16/rm-rf- still-works-on-osx/

slide-26
SLIDE 26

Computers run low-level instructions

 Computers don't "Play Despacito"  Instead, they…

 Move a number from one storage to another  Add two numbers  Check if one number is larger than another  Go to a different place in code

 Programming at this level…

 Is tedious, error prone  Needs a LOT of code to do anything  Isn't portable – each processor type has their own "stuff"

slide-27
SLIDE 27

High-level Languages (like Python!)

 Productive, safer, portable  Why Python? Super useful language, gentle learning curve

 Once you've learned a language, it is easier to learn others!

 We use Python 3 (not Python 2)  Interpreted language

slide-28
SLIDE 28

28

A E D C B

Where does Python run on the computer?

slide-29
SLIDE 29

Video Question – which of the following is NOT something a computer does as an instruction?

slide-30
SLIDE 30

Types and Type Conversion

slide-31
SLIDE 31

Python values have types

 Early into the class, we'll meet two types:

 Strings: e.g., our string literals like “Hello CS 105!”  Integers: whole numbers of arbitrary precision

 You can ask a value what its type is using:

type(expression)

 You can convert between them with str() and

int()

 It is important that you keep track of the types of

your values!

31

slide-32
SLIDE 32

Video Question – what is the type of x if x is assigned using x = 23?

slide-33
SLIDE 33

Input vs Print

slide-34
SLIDE 34

Input vs print

 input() gets user input (from a prompt) and returns a string  We can use input() empty OR with a prompt  print() prints OUTPUT to the screen – usually the same screen where

we get our input from!

 What if I want to get a number input?

slide-35
SLIDE 35

Video question on print

 Assuming there is a variable value with the value 7, which of the

following statements prints: count = 7

A) print(“count =” value) B) print(“count =”, end=“value”) C) print(“count =”, value) D) print(“count =” + value) E) print(“count = $value”)