SlideShare a Scribd company logo
1 of 31
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

Computer Fundamental
Computer FundamentalComputer Fundamental
Computer Fundamentalactanimation
 
The different components of a computer system
The different components of a computer system The different components of a computer system
The different components of a computer system Subagini Manivannan
 
Software and hardware
Software and hardwareSoftware and hardware
Software and hardwaremeryy21
 
Introduction to computers
Introduction to computersIntroduction to computers
Introduction to computersTushar B Kute
 
Coa module1
Coa module1Coa module1
Coa module1cs19club
 
Basic computer organization
Basic computer organizationBasic computer organization
Basic computer organizationNitesh Singh
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)Vaibhav Bajaj
 
Von neumann Architecture | Computer Science
Von neumann Architecture | Computer ScienceVon neumann Architecture | Computer Science
Von neumann Architecture | Computer ScienceTransweb Global Inc
 
Operating system
Operating systemOperating system
Operating systemasmakh89
 
ROM (Read Only Memory)
ROM (Read Only Memory)ROM (Read Only Memory)
ROM (Read Only Memory)JaneAlamAdnan
 
Computer Organization Lecture Notes
Computer Organization Lecture NotesComputer Organization Lecture Notes
Computer Organization Lecture NotesFellowBuddy.com
 
Ahmad sameer types of computer
Ahmad sameer types of computerAhmad sameer types of computer
Ahmad sameer types of computerSameer Nawab
 
Fundamentals Of Computer
Fundamentals Of ComputerFundamentals Of Computer
Fundamentals Of ComputerJack Frost
 
Computer architecture
Computer architectureComputer architecture
Computer architectureZuhaib Zaroon
 

What's hot (20)

Computer software
Computer softwareComputer software
Computer software
 
Boot process
Boot processBoot process
Boot process
 
Introduction to Computers
Introduction to ComputersIntroduction to Computers
Introduction to Computers
 
Computer Fundamental
Computer FundamentalComputer Fundamental
Computer Fundamental
 
The different components of a computer system
The different components of a computer system The different components of a computer system
The different components of a computer system
 
Software and hardware
Software and hardwareSoftware and hardware
Software and hardware
 
Introduction to computers
Introduction to computersIntroduction to computers
Introduction to computers
 
Coa module1
Coa module1Coa module1
Coa module1
 
Basic computer organization
Basic computer organizationBasic computer organization
Basic computer organization
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)
 
Von neumann Architecture | Computer Science
Von neumann Architecture | Computer ScienceVon neumann Architecture | Computer Science
Von neumann Architecture | Computer Science
 
Operating system
Operating systemOperating system
Operating system
 
ROM (Read Only Memory)
ROM (Read Only Memory)ROM (Read Only Memory)
ROM (Read Only Memory)
 
Computer Organization Lecture Notes
Computer Organization Lecture NotesComputer Organization Lecture Notes
Computer Organization Lecture Notes
 
Translators(Compiler, Assembler) and interpreter
Translators(Compiler, Assembler) and interpreterTranslators(Compiler, Assembler) and interpreter
Translators(Compiler, Assembler) and interpreter
 
OPERATING SYSTEM
OPERATING SYSTEMOPERATING SYSTEM
OPERATING SYSTEM
 
Ahmad sameer types of computer
Ahmad sameer types of computerAhmad sameer types of computer
Ahmad sameer types of computer
 
Fundamentals Of Computer
Fundamentals Of ComputerFundamentals Of Computer
Fundamentals Of Computer
 
Memory Hierarchy
Memory HierarchyMemory Hierarchy
Memory Hierarchy
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 

Viewers also liked

Atm flowchart
Atm flowchartAtm flowchart
Atm flowchartnakomuri
 
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 1cois102.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 TechniquesJismy .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 CycleFrankie Jones
 
2.1 Understand problem solving concept
2.1 Understand problem solving concept2.1 Understand problem solving concept
2.1 Understand problem solving conceptFrankie Jones
 
What is artificial intelligence
What is artificial intelligenceWhat is artificial intelligence
What is artificial intelligenceShreya Chakraborty
 
Problem solving ppt
Problem solving pptProblem solving ppt
Problem solving pptIka Rose
 
Problem Solving Method
Problem Solving MethodProblem Solving Method
Problem Solving MethodRoxanne Deang
 

Viewers also liked (11)

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
 
Problem Solving Method
Problem Solving MethodProblem Solving Method
Problem Solving Method
 

Similar to Overview of Programming Concepts and Problem Solving Techniques

Computational thinking
Computational thinkingComputational thinking
Computational thinkingr123457
 
Algo_Lecture01.pptx
Algo_Lecture01.pptxAlgo_Lecture01.pptx
Algo_Lecture01.pptxShaistaRiaz4
 
Cse115 lecture03problemsolving
Cse115 lecture03problemsolvingCse115 lecture03problemsolving
Cse115 lecture03problemsolvingMd. Ashikur Rahman
 
Algorithm week2(technovation)
Algorithm week2(technovation)Algorithm week2(technovation)
Algorithm week2(technovation)than sare
 
Ch4 Performance metrics
Ch4 Performance metricsCh4 Performance metrics
Ch4 Performance metricsJosh Wei
 
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHESC LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHESHarshJha34
 
PA2557_SQM_Lecture7 - Defect Prevention.pdf
PA2557_SQM_Lecture7 - Defect Prevention.pdfPA2557_SQM_Lecture7 - Defect Prevention.pdf
PA2557_SQM_Lecture7 - Defect Prevention.pdfhulk smash
 
Customer Gauge - AIESEC India & CEM
Customer Gauge - AIESEC India & CEMCustomer Gauge - AIESEC India & CEM
Customer Gauge - AIESEC India & CEMarnavsachdev
 
Testing a movingtarget_quest_dynatrace
Testing a movingtarget_quest_dynatraceTesting a movingtarget_quest_dynatrace
Testing a movingtarget_quest_dynatracePeter Varhol
 
2. Algorithms Representations (C++).pptx
2. Algorithms Representations (C++).pptx2. Algorithms Representations (C++).pptx
2. Algorithms Representations (C++).pptxssuser4d77b2
 
unit 1.2 supervised learning.pptx
unit 1.2 supervised learning.pptxunit 1.2 supervised learning.pptx
unit 1.2 supervised learning.pptxDr.Shweta
 

Similar to Overview of Programming Concepts and Problem Solving Techniques (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

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 

Recently uploaded (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 

Overview of Programming Concepts and Problem Solving Techniques

  • 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