Download presentation
Presentation is loading. Please wait.
Published byKarin Hensley Modified over 9 years ago
1
What is programming? Steps to solve a problem. Repeatable by executing or “doing” the steps again. UWP - Landgraf Some slides are from Dr. Qi Yang's notes 1
2
Write a program 1.Problem solve phase 2.Implement phase (Maintenance phase) Program VCR to tape American Idol UWP - Landgraf Some slides are from Dr. Qi Yang's notes 2
3
Problem Solving Solve the problem before writing any program Pseudo Code If score is positive Add score to Total Else Display an error message UWP - Landgraf Some slides are from Dr. Qi Yang's notes 3
4
Algorithm Instructions on how to do something – Details – If you leave out steps… Can you write an algorithm to set an alarm clock? UWP - Landgraf Some slides are from Dr. Qi Yang's notes 4
5
What is a programming language? Set of instructions, rules, and symbols known by a computer that can be interpreted by the computer to solve a problem. UWP - Landgraf Some slides are from Dr. Qi Yang's notes 5
6
High Level Programming Languages C++Java BASICCOBOL English Like Easy to Read and Write (Compared with low level) C++ Code Example Total = Total + Score; UWP - Landgraf Some slides are from Dr. Qi Yang's notes 6
7
Low Level Programming Languages Total = Total + Score; Machine Code 10010110 00000000 10100101 Assembly Code Add AX, Score UWP - Landgraf Some slides are from Dr. Qi Yang's notes 7
8
Programming Steps Create source code file: Lab0.cpp Compile to machine code: Lab0.obj Link to executable program: Lab0.exe Run Lab0.exe UWP - Landgraf Some slides are from Dr. Qi Yang's notes 8
9
What is a computer? UWP - Landgraf Some slides are from Dr. Qi Yang's notes 9 Input Output Storage Network CPU MEMORY
10
Hardware CPU Memory Keyboard Monitor Disk … UWP - Landgraf Some slides are from Dr. Qi Yang's notes 10
11
Problem-Solving Techniques ASK for HELP!!!! Look for things that are familiar – Given salary, compute a 10% salary increase. – Given the price of a product, compute a 10% price increase Solve by analogy – I know how to rollerblade. – This is similar to ice skating. Means/Ends Analysis – If I’m on one side of the river, how can I get to the other side? UWP - Landgraf Some slides are from Dr. Qi Yang's notes 11
12
Problem-Solving Techniques Divide and conquer – Build a house with electrician, carpenter, plumber etc. Building-block approach – Components of a sound system Merging solutions – What things can be done at the same time? UWP - Landgraf Some slides are from Dr. Qi Yang's notes 12
13
Mental Blocks Fear of starting – Just do it Algorithmic problem solving – Not always easy – May fail (it will make you stronger) UWP - Landgraf Some slides are from Dr. Qi Yang's notes 13
14
How to Store Data in Computer UWP - Landgraf Some slides are from Dr. Qi Yang's notes 14 Bit Byte Electronic Device On / Off Value: 1 / 0 8 bits Possible combinations 256 2 8
15
How to Store Data in Computer UWP - Landgraf Some slides are from Dr. Qi Yang's notes 15 2 7 + 2 3 + 2 2 + 2 1 + 2 0 128 + 8 + 4 + 2 + 1 Decimal Number: 143 10001111 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 Binary Number
16
How to Store Data in Computer UWP - Landgraf Some slides are from Dr. Qi Yang's notes 16 01000001 Binary Number 65 Character ASCII (EBCDIC) ASCII Character is See Appendix D pp. 695-696
17
How to Store Data in Computer UWP - Landgraf Some slides are from Dr. Qi Yang's notes 17 Word2 bytes (16 bits) Integers Binary Numbers Characters ASCII Unicode (p. 34 footnote) Float Numbers? Negative numbers? Double Word4 bytes (32 bits)
18
How to Store Data in Computer UWP - Landgraf Some slides are from Dr. Qi Yang's notes 18 KB 1024 Bytes 2 10 MB 1024 * 1024 Bytes 2 20 TB… GB 1024 * 1024 * 1024 Bytes 2 30
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.