Download presentation
Presentation is loading. Please wait.
Published byBob Ewell Modified over 6 years ago
1
Introduction to Problem Solving and Programming CS140: Introduction to Computing 1 8/19/13
2
Computing Is computing is about computers? Computing is ubiquitous – used in every business – used by everyone Being computing fluent is becoming increasingly valuable 2
3
Ubiquity Computers are everywhere – Computers desktops, laptops, … – Things that run apps tablets, smart-phones, iPod, … – Things with USB connectors mp3 players, GPS, cameras, camcorders, … – Less obvious Pacemakers, automobiles, vacuum, toys, … 3
4
Computing is more than Programming Computing (Computer Science) is about problem solving Problems are expressed as data – numeric a ‘problem’ is not a bad thing, it’s a challenge – The big challenge: Making life better medicine, entertainment, communication, convenience, automation, science, safety, … 4
5
Problem Solving Understanding the problem Finding a solution – Correct – Usable – Fast enough, etc. Implementation Maintenance Documentation 5 CS140: Focus on finding and implementing correct solutions (programming) CS140: Focus on finding and implementing correct solutions (programming)
6
Problem Solving and Programming Is a house built before the blueprints are drawn? Problem Solving (design of a solution) should precede the programming 6
7
Programming is more than writing code Programming – representing a general solution to problem set in a way a machine can use, which consists of 1.Design of an Algorithm a step by step solution to a problem that completes in finite time 2.Coding – translate an algorithm into a program 3.Testing – ensuring the correctness of the program 7
8
1. Design developing a solution to the problem similar to the blueprints for a house 8
9
2. Coding Translate / express the solution in a programming language – Often tedious – Since code is the “product”, it is often the focus of effort src: http://xkcd.com/974/ 9
10
3. Testing (Debugging) Understand the system Know the expected behavior Observe the actual behavior Consider possible solutions based on understanding 10 Yes
11
Computing Machinery Computers are machines they have no intelligence – Don’t understand typos, bad grammar, … – Can’t determine the meaning of ambiguous statements – Only do as instructed Programmers provide the intelligence 11
12
Computing Machinery Digital Computers – represent all data (numbers, letters, words, sounds, images, movies, and programs) numerically Internally, all numbers are binary – Bit – a single 1 or 0 (base 2 number system) – Byte – a collection of 8 bits (2 8 possible values) 12
13
Numeric Robots Digital computers are, numeric robots – numeric: only manipulate numbers (any data!) – robots: only do exactly as they are told (obedient, but dumb) (your) program User input 13
14
Abstraction represent only the relevant aspects of the real world (an abstraction) 14
15
Abstraction Detail Removal – Leaving out properties of a complex object Generalization – Formulating general concepts by abstracting general common properties of instances 15
16
Abstraction: Detail Removal Focus on the essence 16
17
Abstraction What is the problem? What is important? What is not important? 17
18
Variables / State The location and speed of items in the crash problem are examples of variables Variables change values (that’s why …) The value of a variable is it’s state Programs have state Computers have state 18
19
Abstraction: essence 19
20
Java is an OO PL Object Oriented – Real World objects are represented by programming ‘objects’ – A programming object is composed of Data values (numbers) that represent essence Actions (changes to the numbers) 20
21
OO example Data X Y Action Forward Turn 21
22
Abstraction: Generalization 22
23
Abstraction: Generalization Specific Problem 2, 10 5, 9 42, 42 Input values 23 Specific Solution 12 14 84 Resulting values General Problem Sum 2 values one general solution
24
Programming is more than writing code once Programming – representing a general solution to problem set in a way a machine can use – representing the ideas of the solution in a way humans can understand Teams Versions 24
25
Learning to Program Programming is like learning to write poetry in a foreign language – You don’t know the language – (I assume) You’re not good at poetry 25
26
Summary Computing is more than programming Programming is more than writing code Computers are stupid Practice programming to learn programming Memorizing the text is a strategy to fail 26
27
Succeeding in CS140 Attend class Start projects early Practice programming Utilize tutors in the open lab Design before code 27
28
Things that are less effective Just reading the textbook Waiting to start projects Skipping design/planning before code Memorizing code 28
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.