SlideShare a Scribd company logo
CS1040: Introduction to Problem
Solving & Programming
Summer 2013
Instructor: Malik Tubaishat
1
University of Missouri
Break the ice
2
Name/Nickname Major Hobbies Summer Plans Brag
Speakers Circle
3
Bio
 http://web.missouri.edu/~mma4n6/
 PhD student in Computer Science
 Lab: MU Center for High Assurance Computing
 Research:
 Wireless Sensor Network and Reinforcement
Learning emphasis on Traffic Engineering
 Machine Learning and Binary Code Analysis
emphasis on Malware Detection
4
Course Website & Blackboard
 Course website:
 http://babbage.cs.missouri.edu/~mma4n6/
 Course Info, slides, assignments, class notes, etc.
 Blackboard:
 https://bblearn.missouri.edu/
 We will use BB for lab assignments submission
only.
5
Exam dates are fixed!6
My Office – EBN 322
Office hours: by appointment
Email: MalikAlJarad@mail.missouri.edu7
My Office – EBN 322
Office hours: by appointment
Email: MalikAlJarad@mail.missouri.edu8
Useful Links
9
 Division of Information Technology
 Computing Sites: locations, hours, etc.
 Request a Bengal Account
 University of Missouri MSDNAA (for
students enrolled in CS courses only)
 Download Visual Basic Express 2010
http://msdn08.e-academy.com/elms/Storefront/Home.aspx?campus=missouri_coms10
Questions?
Break!
11
1.1 An Introduction to
Computers
1.2 Windows, Folders, and
Files
1.3 Program Development12
Chapter 1: An Introduction to
Computers & Problem Solving
1.1 An Introduction to Computers
 Computers
 Programming languages (machine, Assembly,
higher-level)
 Software
 Hardware
 Compiler
 Operating System
13
1.1 An Introduction to Computers
 Computers
 Why do we use computers?
 Components (Hardware)?
 Storage units (RAM, ROM, …)
14
Storage Units
15
 RAM – Random Access Memory
 ROM – Read Only Memory
 Hard Disk
 USB Flash Drive
 SD Card – Secure Digital Card
 ???
5
4
1
2
3
1.1 An Introduction to Computers
16
 Computers
 Why do we use computers?
 Components?
(Monitor, Motherboard, CPU, RAM, Expansion cards,
Power supply, Optical disc drive, Hard disk drive,
Keyboard, Mouse)
 Storage units (RAM, ROM, …)
1.1 An Introduction to Computers
17
 What is a computer program?
 A set of instructions
 We use a programming language to write those
instructions
 Programming languages
 Machine
 Assembly
 High-level
Programming languages
18
19
Programming Languages
 Machine Language (Low-level language)
 Assembly Language (Low-level language)
 High Level Language (example ?)
1001100101010011
1001101001101010
ADD R1,R2
MVR R2,R12
pay = hours * wage;
A: 01000001 (bin.)  65 (dec.)
a: 01100001 (bin.)  97 (dec.)
32-bit and 64-bit?
Bit and Byte?
19
1.1 An Introduction to Computers
20
 Programming languages (machine, Assembly,
higher-level)
 Software
 Compiler/Interpreter
 Operating System
 Andriod, iOS ???
Chapter 1
21
 1.1 An Introduction to Computers
 1.2 Windows, Folders, and Files
 1.3 Program Development Cycle
 1.4 Programming Tools
1.2 Windows, Folders, and Files
22
1.2 Windows, Folders, and Files
23
 File and Filename
 File extension
 Folder and Subfolder
 Path
 Drive name
Chapter 1
24
 1.1 An Introduction to Computers
 1.2 Windows, Folders, and Files
 1.3 Program Development Cycle
 1.4 Programming Tools
1.3 Program Development Cycle
25
 How to solve a problem by writing code?
 Determine Output
 Determine Input
 Determine Process
1.3 Program Development Cycle
26
 Problem: Calculate the average temperature
for the first week of June.
1.3 Program Development Cycle
27
 Problem: Calculate the average temperature
for the first week of June.
 Output:
 Input:
 Process:
1.3 Program Development Cycle
28
 Problem: Calculate the average temperature
for the first week of June.
 Output: average temperature
 Input:
 Process:
1.3 Program Development Cycle
29
 Problem: Calculate the average temperature
for the first week of June.
 Output: average temperature
 Input: t1, t2, …, t7
 Process:
1.3 Program Development Cycle
30
 Problem: Calculate the average temperature
for the first week of June.
 Output: average temperature
 Input: t1, t2, …, t7
 Process:
7
7
1i
it
1.3 Program Development Cycle
1. Analyze: Define the problem.
 Understand the problem
 Ask questions
 What the output should be
 What data (or input) are given
31
32
2. Design: Plan the solution to the
problem.
 Build a logical sequence of steps (Algorithm)
 Test the logic of the steps by using different data
inputs
3. Design the interface: Build GUI
(text boxes, buttons, etc.).
4. Code: Translate the algorithm into
a programming language. (e.g.,
1.3 Program Development Cycle
32
5. Test and debug: Locate and remove any
errors (bugs) in the program.
 Compiler helps debug program
 Syntax and semantic errors – misspelling
or incorrect placement of words
 Run-time errors – program halts
 Logic errors – program produces incorrect output
1.3 Program Development Cycle
33
6. Complete the documentation: Organize all
the materials that describe the program.
1.3 Program Development Cycle
34
1.4 Programming Tools
 Pseudocode – algorithmic steps using English-
like phrases & a programming language terms to
outline a task
 Flowcharts – graphical method to show logical
steps
35
1.4 Programming Tools
 Pseudocode – algorithmic steps using English-like
phrases & a programming language terms to outline a
task
Example: Find the average temperature of a week
1. Input one temperature
2. Add temperature to total (total = total + temperature)
3. Go to step 1
4. Average = total / 7
36
Flowchart Symbols (page 9)
37
38
Flowchart Example
How fast is a car
traveling if it goes 50
miles in 2 hours?
38
Program Structure
 Three main structures for all modern
languages
 Sequence
 Selection (or decision structure)
 Repetition (or loop structure)
39
Program Structure
Sequential
Selection Repetition
40
41
I) Sequence
41
42
II) Decision/Selection
If Time <= 0
Yes
No
42
43
II) Loop/Repetition
If Time <= 0
Yes
No
43
44
Class Average Algorithm
 Problem: Calculate and report the grade-point
average for a class
 Discussion: The average grade equals the sum of
all grades divided by the number of students
Output: Average grade
Input: Student grades
Processing: Find the sum of the grades; count the
number of students; calculate average
44
45
Class Average Algorithm
Pseudocode:
Initialize Counter and Sum to 0
Do While there is more data
Get the next Grade
Increment the Counter
Add the Grade to the Sum
Loop
Compute Average = Sum/Counter
Display Average
45
46
Class Average
Algorithm
Input data: 70, 80, 60
46

More Related Content

Viewers also liked (7)

Tarea de informatica
Tarea de informaticaTarea de informatica
Tarea de informatica
 
.
..
.
 
Trabajo
TrabajoTrabajo
Trabajo
 
Nuevas represent
Nuevas representNuevas represent
Nuevas represent
 
Abia International Industrial City
Abia International Industrial CityAbia International Industrial City
Abia International Industrial City
 
7 eng1
7 eng17 eng1
7 eng1
 
사용자메뉴얼
사용자메뉴얼사용자메뉴얼
사용자메뉴얼
 

Similar to Ch1

Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
Prof. Erwin Globio
 
data Integrative Programming untuk pemula.pdf
data Integrative Programming untuk pemula.pdfdata Integrative Programming untuk pemula.pdf
data Integrative Programming untuk pemula.pdf
loliktry1
 

Similar to Ch1 (20)

ICT 1 - syllabus.pdf
ICT 1 - syllabus.pdfICT 1 - syllabus.pdf
ICT 1 - syllabus.pdf
 
trial
trialtrial
trial
 
01CHAP_1.PPT
01CHAP_1.PPT01CHAP_1.PPT
01CHAP_1.PPT
 
Chapter 10
Chapter 10 Chapter 10
Chapter 10
 
10tait
10tait10tait
10tait
 
Chapter 01.PPT
Chapter 01.PPTChapter 01.PPT
Chapter 01.PPT
 
Student record
Student recordStudent record
Student record
 
Chapter no 1
Chapter no 1Chapter no 1
Chapter no 1
 
Assignments Three And Four Object-Oriented Software Design And Implementatio...
Assignments Three And Four  Object-Oriented Software Design And Implementatio...Assignments Three And Four  Object-Oriented Software Design And Implementatio...
Assignments Three And Four Object-Oriented Software Design And Implementatio...
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
data Integrative Programming untuk pemula.pdf
data Integrative Programming untuk pemula.pdfdata Integrative Programming untuk pemula.pdf
data Integrative Programming untuk pemula.pdf
 
IRJET - Code Compiler Shell
IRJET -  	  Code Compiler ShellIRJET -  	  Code Compiler Shell
IRJET - Code Compiler Shell
 
Ums in c
Ums in cUms in c
Ums in c
 
C++ advanced PPT.pdf
C++ advanced PPT.pdfC++ advanced PPT.pdf
C++ advanced PPT.pdf
 
Module 1 2 just basic-
Module 1 2  just basic-Module 1 2  just basic-
Module 1 2 just basic-
 
Module 201 2 20 just 20 basic
Module 201   2  20  just 20 basic Module 201   2  20  just 20 basic
Module 201 2 20 just 20 basic
 
Into to programming fundamentals
Into to programming fundamentalsInto to programming fundamentals
Into to programming fundamentals
 
Introduction to Software Engineering For Students
Introduction to Software Engineering For StudentsIntroduction to Software Engineering For Students
Introduction to Software Engineering For Students
 
Intro1
Intro1Intro1
Intro1
 
Bt0062 fundamentals of it
Bt0062   fundamentals of itBt0062   fundamentals of it
Bt0062 fundamentals of it
 

Recently uploaded

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 

Recently uploaded (20)

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
UiPath New York Community Day in-person event
UiPath New York Community Day in-person eventUiPath New York Community Day in-person event
UiPath New York Community Day in-person event
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 

Ch1

  • 1. CS1040: Introduction to Problem Solving & Programming Summer 2013 Instructor: Malik Tubaishat 1 University of Missouri
  • 3. Name/Nickname Major Hobbies Summer Plans Brag Speakers Circle 3
  • 4. Bio  http://web.missouri.edu/~mma4n6/  PhD student in Computer Science  Lab: MU Center for High Assurance Computing  Research:  Wireless Sensor Network and Reinforcement Learning emphasis on Traffic Engineering  Machine Learning and Binary Code Analysis emphasis on Malware Detection 4
  • 5. Course Website & Blackboard  Course website:  http://babbage.cs.missouri.edu/~mma4n6/  Course Info, slides, assignments, class notes, etc.  Blackboard:  https://bblearn.missouri.edu/  We will use BB for lab assignments submission only. 5
  • 6. Exam dates are fixed!6
  • 7. My Office – EBN 322 Office hours: by appointment Email: MalikAlJarad@mail.missouri.edu7
  • 8. My Office – EBN 322 Office hours: by appointment Email: MalikAlJarad@mail.missouri.edu8
  • 9. Useful Links 9  Division of Information Technology  Computing Sites: locations, hours, etc.  Request a Bengal Account  University of Missouri MSDNAA (for students enrolled in CS courses only)  Download Visual Basic Express 2010
  • 12. 1.1 An Introduction to Computers 1.2 Windows, Folders, and Files 1.3 Program Development12 Chapter 1: An Introduction to Computers & Problem Solving
  • 13. 1.1 An Introduction to Computers  Computers  Programming languages (machine, Assembly, higher-level)  Software  Hardware  Compiler  Operating System 13
  • 14. 1.1 An Introduction to Computers  Computers  Why do we use computers?  Components (Hardware)?  Storage units (RAM, ROM, …) 14
  • 15. Storage Units 15  RAM – Random Access Memory  ROM – Read Only Memory  Hard Disk  USB Flash Drive  SD Card – Secure Digital Card  ??? 5 4 1 2 3
  • 16. 1.1 An Introduction to Computers 16  Computers  Why do we use computers?  Components? (Monitor, Motherboard, CPU, RAM, Expansion cards, Power supply, Optical disc drive, Hard disk drive, Keyboard, Mouse)  Storage units (RAM, ROM, …)
  • 17. 1.1 An Introduction to Computers 17  What is a computer program?  A set of instructions  We use a programming language to write those instructions  Programming languages  Machine  Assembly  High-level
  • 19. 19 Programming Languages  Machine Language (Low-level language)  Assembly Language (Low-level language)  High Level Language (example ?) 1001100101010011 1001101001101010 ADD R1,R2 MVR R2,R12 pay = hours * wage; A: 01000001 (bin.)  65 (dec.) a: 01100001 (bin.)  97 (dec.) 32-bit and 64-bit? Bit and Byte? 19
  • 20. 1.1 An Introduction to Computers 20  Programming languages (machine, Assembly, higher-level)  Software  Compiler/Interpreter  Operating System  Andriod, iOS ???
  • 21. Chapter 1 21  1.1 An Introduction to Computers  1.2 Windows, Folders, and Files  1.3 Program Development Cycle  1.4 Programming Tools
  • 22. 1.2 Windows, Folders, and Files 22
  • 23. 1.2 Windows, Folders, and Files 23  File and Filename  File extension  Folder and Subfolder  Path  Drive name
  • 24. Chapter 1 24  1.1 An Introduction to Computers  1.2 Windows, Folders, and Files  1.3 Program Development Cycle  1.4 Programming Tools
  • 25. 1.3 Program Development Cycle 25  How to solve a problem by writing code?  Determine Output  Determine Input  Determine Process
  • 26. 1.3 Program Development Cycle 26  Problem: Calculate the average temperature for the first week of June.
  • 27. 1.3 Program Development Cycle 27  Problem: Calculate the average temperature for the first week of June.  Output:  Input:  Process:
  • 28. 1.3 Program Development Cycle 28  Problem: Calculate the average temperature for the first week of June.  Output: average temperature  Input:  Process:
  • 29. 1.3 Program Development Cycle 29  Problem: Calculate the average temperature for the first week of June.  Output: average temperature  Input: t1, t2, …, t7  Process:
  • 30. 1.3 Program Development Cycle 30  Problem: Calculate the average temperature for the first week of June.  Output: average temperature  Input: t1, t2, …, t7  Process: 7 7 1i it
  • 31. 1.3 Program Development Cycle 1. Analyze: Define the problem.  Understand the problem  Ask questions  What the output should be  What data (or input) are given 31
  • 32. 32 2. Design: Plan the solution to the problem.  Build a logical sequence of steps (Algorithm)  Test the logic of the steps by using different data inputs 3. Design the interface: Build GUI (text boxes, buttons, etc.). 4. Code: Translate the algorithm into a programming language. (e.g., 1.3 Program Development Cycle 32
  • 33. 5. Test and debug: Locate and remove any errors (bugs) in the program.  Compiler helps debug program  Syntax and semantic errors – misspelling or incorrect placement of words  Run-time errors – program halts  Logic errors – program produces incorrect output 1.3 Program Development Cycle 33
  • 34. 6. Complete the documentation: Organize all the materials that describe the program. 1.3 Program Development Cycle 34
  • 35. 1.4 Programming Tools  Pseudocode – algorithmic steps using English- like phrases & a programming language terms to outline a task  Flowcharts – graphical method to show logical steps 35
  • 36. 1.4 Programming Tools  Pseudocode – algorithmic steps using English-like phrases & a programming language terms to outline a task Example: Find the average temperature of a week 1. Input one temperature 2. Add temperature to total (total = total + temperature) 3. Go to step 1 4. Average = total / 7 36
  • 38. 38 Flowchart Example How fast is a car traveling if it goes 50 miles in 2 hours? 38
  • 39. Program Structure  Three main structures for all modern languages  Sequence  Selection (or decision structure)  Repetition (or loop structure) 39
  • 44. 44 Class Average Algorithm  Problem: Calculate and report the grade-point average for a class  Discussion: The average grade equals the sum of all grades divided by the number of students Output: Average grade Input: Student grades Processing: Find the sum of the grades; count the number of students; calculate average 44
  • 45. 45 Class Average Algorithm Pseudocode: Initialize Counter and Sum to 0 Do While there is more data Get the next Grade Increment the Counter Add the Grade to the Sum Loop Compute Average = Sum/Counter Display Average 45

Editor's Notes

  1. http://home2.paulschou.net/tools/xlate/http://www.roubaixinteractive.com/PlayGround/Binary_Conversion/Binary_To_Text.asp
  2. parallelogram