SlideShare a Scribd company logo
Chapter 1
Overview of Programming
and Problem Solving
What is Programming?
• LOGICALLY SEQUENTIAL thought
• Order of things and actions
Computer Programming
The process of planning a
sequence of steps for a
computer to follow.
Computer Program
A sequence of instructions to be
performed by a computer.
Computer Program
Processing
Function
inputs outputs
Computer Programming
• Computer is a powerful tool
• It is not intelligent!
• In order to use computer to solve our problems,
we must tell it what we want done and the order
in which we want it done.
• These instructions are called computer program.
• This process is called computer programming.
• The person giving these instructions is called a
computer programmer.
Computer Programming
• Analyze the problem
• Develop a sequence of instructions for
solving the problem.
• Communicate it to the computer.
Computer Programs
Once written, computer can repeat
the solution very quickly and
CONSISTENTLY.
Programming Language
A set of rules, symbols, and special
words used to construct a
computer program.
Phases of the software life cycle
• Requirement Definition
• Analysis and design
• Coding
• Testing
• Implementation
• Maintenance
Two Phase Process
• Problem solving
– Analysis and specification
– General solution (algorithm)
– Verification
• Implementation
– Concrete solution (program)
– Test
Problem Solving Techniques
• Ask questions
• Look for things that are similar
• Means-ends analysis
• Divide and Conquer
• Merging solutions
Ask Questions
• Ask questions until you have developed a clear
understanding of the problem.
• Who, What, Why, Where, When.
– What do I have to work with? (my data or input)
– How much data is there?
– What should my output look like?
– How many times is the process going to be
repeated?
– What are the exceptions to the main course?
– What special error condition might come up?
Look for things that are familiar
• Do not reinvent the wheel!
• Draw Analogies
Means-Ends analysis
• Starting point and ending state are known.
• You need to devise the transformation
function.
• Ends are defined – you need to analyze
your means of getting between them.
• Lahore to Islamabad
– What are the options?
– Narrow down the options?
– Figure out the details?
Divide and Conquer
• Same as the Alkhwarzimi Principle.
• Breakup the large problem into smaller
units and then solve them one at a time.
• Building block approach.
Divide and Conquer
Hard Problem
Hard Sub-problemEasy Sub-problem Easy Sub-problem
Easy Sub-problemEasy Sub-problem
Divide
and
Conquer
Merging Solution
• Sometimes merging two independent
solutions solves the problem more
efficiently?
• Calculate Average
– Count values
– Sum Values
– Divide sum by count
• Alternative approach
– calculate partial sum as you count
Problem Solving Techniques
• What is the unknown?
– What is required?
– What do you want?
– What are you supposed to seek?
• What are the data?
– What is given?
– What have you?
• What is the condition?
– By what condition the unknown is linked to the
data?
A Puzzle
A man, starting from point P, walked one mile due
South. Then he changed direction and walked
one mile due East. Then he turned to the left and
walked one mile due North, and arrived at exactly
at the point P he started from. During his journey,
he saw a bear. What is the color of the bear?
What is the unknown?
How could we find the color of the bear from the mathematical
data?
Where is the link?
Conversion from Fahrenheit to Celsius
• Output
– Temperature in Celsius (C)
• Inputs
– Temperature in Fahrenheit (F)
• Process
32)(F
9
5
C −=
Algorithm
Make a Jam and Butter Sandwich
• Output
– Jam and Butter Sandwiches
• Inputs
– Jam, Butter, Bread, Knife, Plate
• Process
1. Put two slices of bread on the plate
2. Using the knife, spread butter on one side
3. Using the knife, spread jam on the other
side
4. Put the two slices together, clean side out
5. Repeat from step 1 to 4 to prepare more
sandwiches
Calculate and print the average grade of
3 tests for the entire class
• Input
– 3 test scores for each student
• output
– Average of 3 tests for each student
• Process
1. Get three scores
2. Add them together
3. Divide by three to get the average
4. Print the average
5. Repeat step 1 to 4 for next student
6. Stop if there are no more students
Algorithm
ATM for withdrawal
• Output
– Money, error messages
• Inputs
– User Identification (ATM card), password,
amount
ATM for withdrawal - Process
1. Get the ATM card for identification and ask for
password
2. Check password
3. If password is not valid, generate an error
message and go to step number 8.
4. Get the amount from the user
5. Check the current balance
6. If amount is greater than current balance,
generate an error message and go to step
number 8.
7. Subtract the amount from the balance and give
out the cash.
8. Return the ATM card
9. Stop
Flow Charting
Expresses the flow of processing in a
structured pictorial format.
Processing
Steps
Input and
Output Steps
Decision
Flow
of
data
Connectors
Terminator
Flow chart for
Converting
Fahrenheit
into Celsius
Get temp. in ‘F’
Print ‘C’
Calculate )32(F
9
5
C −=
Stop
Get bread, butter,
jam, knife, and plate
Put two slices of
bread on the plate
Spread butter on one slice
Spread Jam on the other slice
Put the two slices together,
sticky side in
Want another?
Yes
Stop
No
Flow chart for
preparing a
butter and jam
sandwich
Add them together
Divide the result by three
More students?
Yes
Stop
No
Flow chart for
calculating
average of
three scores
Get three scores
Print the average
Get Password
Is Password
Correct?
Get amount
Yes
Is amount <
Balance
No
Generate
Error Message
No
Generate
Error Message
Subtract amount
from balance
Yes
Stop
Return
ATM card
ATM cash withdrawal process
Dispense cash

More Related Content

What's hot

FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
03062679929
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
Abhishek Dwivedi
 
golden rules of user interface design
golden rules of user interface designgolden rules of user interface design
golden rules of user interface design
gadige harshini
 
Software engineering lecture notes
Software engineering lecture notesSoftware engineering lecture notes
Software engineering lecture notes
Siva Ayyakutti
 
Design Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software EngineeringDesign Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software Engineering
Meghaj Mallick
 
C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#
Dr.Neeraj Kumar Pandey
 
File system vs DBMS
File system vs DBMSFile system vs DBMS
File system vs DBMS
BHARATH KUMAR
 
Von Neumann Architecture
Von Neumann ArchitectureVon Neumann Architecture
Von Neumann Architecture
Chamodi Adikaram
 
Algorithm Design Presentation
Algorithm Design PresentationAlgorithm Design Presentation
Algorithm Design Presentation
Kawsar Ahmed
 
Improving software econimics
Improving software econimicsImproving software econimics
Improving software econimics
Kalica Wadhwa
 
Let us c yashwant kanetkar(1)
Let us c   yashwant kanetkar(1)Let us c   yashwant kanetkar(1)
Let us c yashwant kanetkar(1)
OMWOMA JACKSON
 
C programming for problem solving
C programming for problem solving  C programming for problem solving
C programming for problem solving
Anuradha Moti T
 
Introduction to c++ ppt 1
Introduction to c++ ppt 1Introduction to c++ ppt 1
Introduction to c++ ppt 1
Prof. Dr. K. Adisesha
 
Software re engineering
Software re engineeringSoftware re engineering
Software re engineering
deshpandeamrut
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
Sudarsun Santhiappan
 
1 introduction to problem solving and programming
1 introduction to problem solving and programming1 introduction to problem solving and programming
1 introduction to problem solving and programming
Rheigh Henley Calderon
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithm
rajkumar1631010038
 
Interface specification
Interface specificationInterface specification
Interface specification
maliksiddique1
 
Top down design
Top down designTop down design
Top down design
Chaffey College
 
C++ chapter 1
C++ chapter 1C++ chapter 1
C++ chapter 1
jasvinder162
 

What's hot (20)

FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
 
golden rules of user interface design
golden rules of user interface designgolden rules of user interface design
golden rules of user interface design
 
Software engineering lecture notes
Software engineering lecture notesSoftware engineering lecture notes
Software engineering lecture notes
 
Design Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software EngineeringDesign Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software Engineering
 
C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#
 
File system vs DBMS
File system vs DBMSFile system vs DBMS
File system vs DBMS
 
Von Neumann Architecture
Von Neumann ArchitectureVon Neumann Architecture
Von Neumann Architecture
 
Algorithm Design Presentation
Algorithm Design PresentationAlgorithm Design Presentation
Algorithm Design Presentation
 
Improving software econimics
Improving software econimicsImproving software econimics
Improving software econimics
 
Let us c yashwant kanetkar(1)
Let us c   yashwant kanetkar(1)Let us c   yashwant kanetkar(1)
Let us c yashwant kanetkar(1)
 
C programming for problem solving
C programming for problem solving  C programming for problem solving
C programming for problem solving
 
Introduction to c++ ppt 1
Introduction to c++ ppt 1Introduction to c++ ppt 1
Introduction to c++ ppt 1
 
Software re engineering
Software re engineeringSoftware re engineering
Software re engineering
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
1 introduction to problem solving and programming
1 introduction to problem solving and programming1 introduction to problem solving and programming
1 introduction to problem solving and programming
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithm
 
Interface specification
Interface specificationInterface specification
Interface specification
 
Top down design
Top down designTop down design
Top down design
 
C++ chapter 1
C++ chapter 1C++ chapter 1
C++ chapter 1
 

Viewers also liked

Atm flowchart
Atm flowchartAtm flowchart
Atm flowchart
nakomuri
 
PROBLEM SOLVING POWERPOINT
PROBLEM SOLVING POWERPOINT PROBLEM SOLVING POWERPOINT
PROBLEM SOLVING POWERPOINT
Andrew Schwartz
 
COIS 102 - Chapter 1
COIS 102 - Chapter 1COIS 102 - Chapter 1
COIS 102 - Chapter 1
cois102.ut
 
flowchart pembukaan rekening baru
flowchart pembukaan rekening baruflowchart pembukaan rekening baru
flowchart pembukaan rekening barunurul lina musadad
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search Techniques
Jismy .K.Jose
 
2.2 Demonstrate the understanding of Programming Life Cycle
2.2 Demonstrate the understanding of Programming Life Cycle2.2 Demonstrate the understanding of Programming Life Cycle
2.2 Demonstrate the understanding of Programming Life Cycle
Frankie Jones
 
2.1 Understand problem solving concept
2.1 Understand problem solving concept2.1 Understand problem solving concept
2.1 Understand problem solving concept
Frankie Jones
 
Atm.ppt
Atm.pptAtm.ppt
Atm.ppt
siva edara
 
What is artificial intelligence
What is artificial intelligenceWhat is artificial intelligence
What is artificial intelligence
Shreya Chakraborty
 
Problem solving ppt
Problem solving pptProblem solving ppt
Problem solving ppt
Ika Rose
 

Viewers also liked (10)

Atm flowchart
Atm flowchartAtm flowchart
Atm flowchart
 
PROBLEM SOLVING POWERPOINT
PROBLEM SOLVING POWERPOINT PROBLEM SOLVING POWERPOINT
PROBLEM SOLVING POWERPOINT
 
COIS 102 - Chapter 1
COIS 102 - Chapter 1COIS 102 - Chapter 1
COIS 102 - Chapter 1
 
flowchart pembukaan rekening baru
flowchart pembukaan rekening baruflowchart pembukaan rekening baru
flowchart pembukaan rekening baru
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search Techniques
 
2.2 Demonstrate the understanding of Programming Life Cycle
2.2 Demonstrate the understanding of Programming Life Cycle2.2 Demonstrate the understanding of Programming Life Cycle
2.2 Demonstrate the understanding of Programming Life Cycle
 
2.1 Understand problem solving concept
2.1 Understand problem solving concept2.1 Understand problem solving concept
2.1 Understand problem solving concept
 
Atm.ppt
Atm.pptAtm.ppt
Atm.ppt
 
What is artificial intelligence
What is artificial intelligenceWhat is artificial intelligence
What is artificial intelligence
 
Problem solving ppt
Problem solving pptProblem solving ppt
Problem solving ppt
 

Similar to Chapter #1 overview of programming and problem solving

Computational thinking
Computational thinkingComputational thinking
Computational thinking
r123457
 
Algo_Lecture01.pptx
Algo_Lecture01.pptxAlgo_Lecture01.pptx
Algo_Lecture01.pptx
ShaistaRiaz4
 
FDS Unit I_PPT.pptx
FDS Unit I_PPT.pptxFDS Unit I_PPT.pptx
FDS Unit I_PPT.pptx
sayalishivarkar1
 
Cse115 lecture03problemsolving
Cse115 lecture03problemsolvingCse115 lecture03problemsolving
Cse115 lecture03problemsolving
Md. Ashikur Rahman
 
Problem solving
Problem solvingProblem solving
Problem solving
hamza239523
 
Problem solving
Problem solvingProblem solving
Problem solving
samina khan
 
Algorithm week2(technovation)
Algorithm week2(technovation)Algorithm week2(technovation)
Algorithm week2(technovation)
than sare
 
Ch4 Performance metrics
Ch4 Performance metricsCh4 Performance metrics
Ch4 Performance metrics
Josh Wei
 
Lecture 24
Lecture 24Lecture 24
Lecture 24
Skillspire LLC
 
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHESC LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
HarshJha34
 
PA2557_SQM_Lecture7 - Defect Prevention.pdf
PA2557_SQM_Lecture7 - Defect Prevention.pdfPA2557_SQM_Lecture7 - Defect Prevention.pdf
PA2557_SQM_Lecture7 - Defect Prevention.pdf
hulk smash
 
PROBLEM SOLVING.pptx
PROBLEM SOLVING.pptxPROBLEM SOLVING.pptx
PROBLEM SOLVING.pptx
sumathysenthilkumar
 
PPS_Unit 1.pptx
PPS_Unit 1.pptxPPS_Unit 1.pptx
PPS_Unit 1.pptx
KundanBhatkar
 
Customer Gauge - AIESEC India & CEM
Customer Gauge - AIESEC India & CEMCustomer Gauge - AIESEC India & CEM
Customer Gauge - AIESEC India & CEM
arnavsachdev
 
Algorithms 1
Algorithms 1Algorithms 1
Flowcharts
FlowchartsFlowcharts
Flowcharts
cassandra0012345
 
Testing a movingtarget_quest_dynatrace
Testing a movingtarget_quest_dynatraceTesting a movingtarget_quest_dynatrace
Testing a movingtarget_quest_dynatrace
Peter Varhol
 
2. Algorithms Representations (C++).pptx
2. Algorithms Representations (C++).pptx2. Algorithms Representations (C++).pptx
2. Algorithms Representations (C++).pptx
ssuser4d77b2
 
Lecture01.ppt
Lecture01.pptLecture01.ppt
Lecture01.ppt
InamUllahKhan961803
 
unit 1.2 supervised learning.pptx
unit 1.2 supervised learning.pptxunit 1.2 supervised learning.pptx
unit 1.2 supervised learning.pptx
Dr.Shweta
 

Similar to Chapter #1 overview of programming and problem solving (20)

Computational thinking
Computational thinkingComputational thinking
Computational thinking
 
Algo_Lecture01.pptx
Algo_Lecture01.pptxAlgo_Lecture01.pptx
Algo_Lecture01.pptx
 
FDS Unit I_PPT.pptx
FDS Unit I_PPT.pptxFDS Unit I_PPT.pptx
FDS Unit I_PPT.pptx
 
Cse115 lecture03problemsolving
Cse115 lecture03problemsolvingCse115 lecture03problemsolving
Cse115 lecture03problemsolving
 
Problem solving
Problem solvingProblem solving
Problem solving
 
Problem solving
Problem solvingProblem solving
Problem solving
 
Algorithm week2(technovation)
Algorithm week2(technovation)Algorithm week2(technovation)
Algorithm week2(technovation)
 
Ch4 Performance metrics
Ch4 Performance metricsCh4 Performance metrics
Ch4 Performance metrics
 
Lecture 24
Lecture 24Lecture 24
Lecture 24
 
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHESC LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
 
PA2557_SQM_Lecture7 - Defect Prevention.pdf
PA2557_SQM_Lecture7 - Defect Prevention.pdfPA2557_SQM_Lecture7 - Defect Prevention.pdf
PA2557_SQM_Lecture7 - Defect Prevention.pdf
 
PROBLEM SOLVING.pptx
PROBLEM SOLVING.pptxPROBLEM SOLVING.pptx
PROBLEM SOLVING.pptx
 
PPS_Unit 1.pptx
PPS_Unit 1.pptxPPS_Unit 1.pptx
PPS_Unit 1.pptx
 
Customer Gauge - AIESEC India & CEM
Customer Gauge - AIESEC India & CEMCustomer Gauge - AIESEC India & CEM
Customer Gauge - AIESEC India & CEM
 
Algorithms 1
Algorithms 1Algorithms 1
Algorithms 1
 
Flowcharts
FlowchartsFlowcharts
Flowcharts
 
Testing a movingtarget_quest_dynatrace
Testing a movingtarget_quest_dynatraceTesting a movingtarget_quest_dynatrace
Testing a movingtarget_quest_dynatrace
 
2. Algorithms Representations (C++).pptx
2. Algorithms Representations (C++).pptx2. Algorithms Representations (C++).pptx
2. Algorithms Representations (C++).pptx
 
Lecture01.ppt
Lecture01.pptLecture01.ppt
Lecture01.ppt
 
unit 1.2 supervised learning.pptx
unit 1.2 supervised learning.pptxunit 1.2 supervised learning.pptx
unit 1.2 supervised learning.pptx
 

Recently uploaded

WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
TMU毕业证书精仿办理
TMU毕业证书精仿办理TMU毕业证书精仿办理
TMU毕业证书精仿办理
aeeva
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Tier1 app
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio, Inc.
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
campbellclarkson
 
Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)
alowpalsadig
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
narinav14
 
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
The Third Creative Media
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
OnePlan Solutions
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
Envertis Software Solutions
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
Jhone kinadey
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
Orca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container OrchestrationOrca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container Orchestration
Pedro J. Molina
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 

Recently uploaded (20)

WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
TMU毕业证书精仿办理
TMU毕业证书精仿办理TMU毕业证书精仿办理
TMU毕业证书精仿办理
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
 
Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
 
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
Orca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container OrchestrationOrca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container Orchestration
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 

Chapter #1 overview of programming and problem solving

  • 1. Chapter 1 Overview of Programming and Problem Solving
  • 2. What is Programming? • LOGICALLY SEQUENTIAL thought • Order of things and actions
  • 3. Computer Programming The process of planning a sequence of steps for a computer to follow.
  • 4. Computer Program A sequence of instructions to be performed by a computer.
  • 6. Computer Programming • Computer is a powerful tool • It is not intelligent! • In order to use computer to solve our problems, we must tell it what we want done and the order in which we want it done. • These instructions are called computer program. • This process is called computer programming. • The person giving these instructions is called a computer programmer.
  • 7. Computer Programming • Analyze the problem • Develop a sequence of instructions for solving the problem. • Communicate it to the computer.
  • 8. Computer Programs Once written, computer can repeat the solution very quickly and CONSISTENTLY.
  • 9. Programming Language A set of rules, symbols, and special words used to construct a computer program.
  • 10. Phases of the software life cycle • Requirement Definition • Analysis and design • Coding • Testing • Implementation • Maintenance
  • 11. Two Phase Process • Problem solving – Analysis and specification – General solution (algorithm) – Verification • Implementation – Concrete solution (program) – Test
  • 12. Problem Solving Techniques • Ask questions • Look for things that are similar • Means-ends analysis • Divide and Conquer • Merging solutions
  • 13. Ask Questions • Ask questions until you have developed a clear understanding of the problem. • Who, What, Why, Where, When. – What do I have to work with? (my data or input) – How much data is there? – What should my output look like? – How many times is the process going to be repeated? – What are the exceptions to the main course? – What special error condition might come up?
  • 14. Look for things that are familiar • Do not reinvent the wheel! • Draw Analogies
  • 15. Means-Ends analysis • Starting point and ending state are known. • You need to devise the transformation function. • Ends are defined – you need to analyze your means of getting between them. • Lahore to Islamabad – What are the options? – Narrow down the options? – Figure out the details?
  • 16. Divide and Conquer • Same as the Alkhwarzimi Principle. • Breakup the large problem into smaller units and then solve them one at a time. • Building block approach.
  • 17. Divide and Conquer Hard Problem Hard Sub-problemEasy Sub-problem Easy Sub-problem Easy Sub-problemEasy Sub-problem
  • 19. Merging Solution • Sometimes merging two independent solutions solves the problem more efficiently? • Calculate Average – Count values – Sum Values – Divide sum by count • Alternative approach – calculate partial sum as you count
  • 20. Problem Solving Techniques • What is the unknown? – What is required? – What do you want? – What are you supposed to seek? • What are the data? – What is given? – What have you? • What is the condition? – By what condition the unknown is linked to the data?
  • 21. A Puzzle A man, starting from point P, walked one mile due South. Then he changed direction and walked one mile due East. Then he turned to the left and walked one mile due North, and arrived at exactly at the point P he started from. During his journey, he saw a bear. What is the color of the bear? What is the unknown? How could we find the color of the bear from the mathematical data? Where is the link?
  • 22. Conversion from Fahrenheit to Celsius • Output – Temperature in Celsius (C) • Inputs – Temperature in Fahrenheit (F) • Process 32)(F 9 5 C −=
  • 23. Algorithm Make a Jam and Butter Sandwich • Output – Jam and Butter Sandwiches • Inputs – Jam, Butter, Bread, Knife, Plate • Process 1. Put two slices of bread on the plate 2. Using the knife, spread butter on one side 3. Using the knife, spread jam on the other side 4. Put the two slices together, clean side out 5. Repeat from step 1 to 4 to prepare more sandwiches
  • 24. Calculate and print the average grade of 3 tests for the entire class • Input – 3 test scores for each student • output – Average of 3 tests for each student • Process 1. Get three scores 2. Add them together 3. Divide by three to get the average 4. Print the average 5. Repeat step 1 to 4 for next student 6. Stop if there are no more students
  • 25. Algorithm ATM for withdrawal • Output – Money, error messages • Inputs – User Identification (ATM card), password, amount
  • 26. ATM for withdrawal - Process 1. Get the ATM card for identification and ask for password 2. Check password 3. If password is not valid, generate an error message and go to step number 8. 4. Get the amount from the user 5. Check the current balance 6. If amount is greater than current balance, generate an error message and go to step number 8. 7. Subtract the amount from the balance and give out the cash. 8. Return the ATM card 9. Stop
  • 27. Flow Charting Expresses the flow of processing in a structured pictorial format. Processing Steps Input and Output Steps Decision Flow of data Connectors Terminator
  • 28. Flow chart for Converting Fahrenheit into Celsius Get temp. in ‘F’ Print ‘C’ Calculate )32(F 9 5 C −= Stop
  • 29. Get bread, butter, jam, knife, and plate Put two slices of bread on the plate Spread butter on one slice Spread Jam on the other slice Put the two slices together, sticky side in Want another? Yes Stop No Flow chart for preparing a butter and jam sandwich
  • 30. Add them together Divide the result by three More students? Yes Stop No Flow chart for calculating average of three scores Get three scores Print the average
  • 31. Get Password Is Password Correct? Get amount Yes Is amount < Balance No Generate Error Message No Generate Error Message Subtract amount from balance Yes Stop Return ATM card ATM cash withdrawal process Dispense cash