SlideShare a Scribd company logo
Problem Solving
What is Problem Solving
This is the process that requires a critical
analysis of the situation(the problem)
and careful consideration of possible ways of
over coming the problem (solving).
Steps for problem solving
⚫Define the problem
⚫Propose and analyze solution
⚫Determine the most efficient solution
⚫Develop and represent the algorithm
⚫Test and validate the solution.
Define the Problem
Define the problem means to get a good
understanding of the problem to find out what
we are supposed to do.
Proposes and analyze solution
This is the stage where you should concentrate
on considering alternative solution to the
problem.
Determine the most efficient solution
In this stage you consider which solution is the
best.
Both solution can solve the problem. However use
the
one which is most efficient.
Develop and Algorithm
Once the solution is selected. It is time to put it in
action. It is a systematic procedure to show you how to
implement the solution (algorithm).
What is an Algorithm
An algorithm is a set of instructions that if when
followed in a sequence will lead to a solution for the
problem.
Characteristics of Algorithm
1. Must be precise 4. Must pass the flow of
control
2. Must be unambiguous from one process to
another.
3. Eventually terminate
Test and Validate the solution
This is the final step. This is where you see if the
problem works in other word if it is solve. One
way of test is by using a flow chart.
Example 1
Add two number and find their sum
Input Process Output
Num 1
Num 2
Sum=num1+
num 2
sum
solutio
n
Constants and Variables
⚫Program data are like ingredients in a recipe,
must be stored in a suitable container.
⚫Constants is a data item with a name and value
that remains the same during the execution of a
program .
Eg. Pie = 3.14
⚫ Variable is a named storage area whose contents
can be changed.
Program Data Constants/variable Proposed variable
name
Price per hour Constant priceperhour
Number of hours Variable numberofhours
Total cost Variable totalcost
Data types
A data type is a classification or category of
various data
that states the possible values that can be taken,
how
they are sorted and shat range of operations are
allowed
on them.
Data type Possible values Examples
integer Any whole
number
0,-27,540
Real Any decimal
number
13.5,2.1427, -8.0
Character Any single value D, K, @. #
String Multiple
characters
Frank, jack
Boolean Two possible True/false ,
Program Data Constants/
variable
Proposed
variable name
Data type
Price per hour Constant priceperhour real
Number of hours Variable numberofhours Integer
Total cost Variable totalcost Integer/real
PROGRAM ProgramName (FileList); CONST (* Constant declarations *) TYPE (* Type declarations *) VAR (* Variable declarations *) (* Subprogram definitions
*) BEGIN (* Executable statements *) END.
What do you
want to do
Verb to use How to use it
Input
Input
Read
Get
Input name
Get price
Read num
Output
Print
Display
Write
Output
Print “sum”
Display “sum”
Write ”sum”
Output ”sum”
Processing
Age
Sum
Age = 14
Sum:
num1+num2
Decision
If, then If x > 20 then
Printer x
Repetition
While While x> 5 do
The basic structure of a Pascal
program is:
PROGRAM ProgramName (FileList);
CONST (* Constant declarations *) (not mandatory)
VAR (* Variable declarations *) (* Subprogram definitions *)
BEGIN (* Executable statements *)
END.
Read/Readln
⚫The READ and READLN instructions read a
variable from the keyboard. The command will
continue to read until ENTER is pressed (with an
exception). In contrast
with READ, READLN reads the variable and,
when the user pressed ENTER, it moves the
cursor on the next line.
⚫These instructions can read one variable or more
variables. For example:
Read two numbers and find their sum. Print their sum
Algorithm
Algorithm Cal
Var num1,num2,sum:integer
Start
Output(‘Please enter a number’)
Read(num1)
Output(‘Please enter a second
number’)
Read(num2)
sum num1+num2
Output(‘the sum is’, sum)
Stop
Pascal
Program Cal;
Var num1,num2,sum:integer;
Begin
Writeln (‘Please enter a number’);
Readln(num1);
Writeln(‘Please enter a second number’);
Readln(num2);
Sum:=num1+num2;
Writeln(‘the sum is’, sum);
Readln;
End.
Types of errors
⚫Syntax – are errors in the way we use the
programming language.
⚫Logic – are mistake in the design of the program
such as a branch to a wrong statement.
⚫Run Time –is a program flaw detected during
program execution which may cause the
program to terminate abnormally.
Using a constant
program cal;
const
a = 5;
b = 385.3;
Var
alpha, beta : real;
begin
alpha := a + b;
beta := b / a ;
Writeln('the answer is', alpha ,
beta);
readln;
end.
Without a constant
program cal;
Var
alpha, beta,a,b : real;
begin
Writeln('please enter a figure for a');
Readln(a);
Writeln('please enter a figure for b');
Readln(b);
alpha := a + b;
beta := b / a ;
Writeln('the answer is', alpha , beta);
readln;
end.
Terms to know
⚫ Low level languages – Generation 1 and 2
⚫ High level languages – Generation 3 to 5
⚫ Source code – This is a sequence of statement in a programming
language.
⚫ Translator – is a system program that converts a program
written in the source code to machine code.
⚫ Compiler- is a system program that processes all the line of code
in an entire program.
⚫ Object code – This contains the machine instruction for
executable program and is used to create the finish executable
program in another process called linking.
⚫Interpreter – is a translator of a high level
programming language that translate and run
the program at the same time.
Write a an array to read ten numbers and calculate their sum. Print sum.
Program summm;
var
num:array[1..2] of integer;
sum, x: integer;
begin
Writeln('Let us write our first array');
for x:= 1 to 2 do begin
Writeln('Plese enter a number');
Readln(num[x]);
sum:= sum + num[x];
end;
Writeln('The sum is',' ',sum);
Writeln('Congrats for writings your first array');
end.
Write an array to read 10 numbers and print
the numbers
Program summm;
var
num:array[1..2] of integer;
x: integer;
Begin
for x:= 1 to 2 do begin
Writeln('Plese enter a number');
Readln(num[x]);
end;
Writeln;
Writeln;
for x:= 1 to 2 do begin
Writeln('The numbers are',' ',num[x]);
end;
end.
Program Counterr;
var
name:array[1..2] of string;
num:array[1..2] of integer;
x, y, z: integer;
begin
y:=0;
z:=0;
for x:= 1 to 2 do begin
Writeln('Cources offered are:');
Writeln ('1 Mathematics');
Writeln ('2 English');
Writeln('Please press 1 for Mathematics and 2 for English');
Readln(num[x]);
Writeln('Plese enter you name');
Readln(name[x]);
if num[x]= 1 then
y:=y+1;
if num[x] = 2 then
z:=z+1;
end;
Writeln('Total for Mathematics is',' ', y);
Writeln('Total for English is',' ', z);
end.
Write a program to read the names
of students who register for
Mathematics and English. Display
the number of students for each
course.

More Related Content

PPTX
Software fundamentals
PPT
lec_4_data_structures_and_algorithm_analysis.ppt
PPT
lec_4_data_structures_and_algorithm_analysis.ppt
PPT
Programming Fundamentals - Lecture 1.ppt
PDF
BCA 1st semester Problem Solving Notes using C.pdf
PPTX
UNIT 1.pptx Programming for Problem Solving
PPT
Chapter 5( programming) answer
PDF
structured programming Introduction to c fundamentals
Software fundamentals
lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.ppt
Programming Fundamentals - Lecture 1.ppt
BCA 1st semester Problem Solving Notes using C.pdf
UNIT 1.pptx Programming for Problem Solving
Chapter 5( programming) answer
structured programming Introduction to c fundamentals

Similar to Problem Solving PPT Slides Grade 10- 11students (20)

PPTX
Design and Analysis of Algorithms.pptx
PPTX
General Programming Concept
DOCX
Lecture1
PPT
C++ programming program design including data structures
PPT
Computer Programming Computer Programming
PPSX
Problem solving and design
PPT
Data Structures- Part1 overview and review
PPTX
Full Basic Programming in c material ppt
PPT
starting_pascal_programming_for_beginner
PPTX
introduction to problem solving and programming
PPT
01CHAP_1.PPT
DOCX
UNIT-1.docx Design and Analysis of Algorithm
PPT
Intro to DSAA.ppt
PPTX
Algorithm and psuedocode
PPTX
Computer Studies 2013 Curriculum framework 11 Notes ppt.pptx
PPTX
CSE115 C Programming Introduction North south university
PDF
L1. Basic Programming Concepts.pdf
PDF
Problem solving using computers - Unit 1 - Study material
PPT
computer programming introduction ppt.ppt
Design and Analysis of Algorithms.pptx
General Programming Concept
Lecture1
C++ programming program design including data structures
Computer Programming Computer Programming
Problem solving and design
Data Structures- Part1 overview and review
Full Basic Programming in c material ppt
starting_pascal_programming_for_beginner
introduction to problem solving and programming
01CHAP_1.PPT
UNIT-1.docx Design and Analysis of Algorithm
Intro to DSAA.ppt
Algorithm and psuedocode
Computer Studies 2013 Curriculum framework 11 Notes ppt.pptx
CSE115 C Programming Introduction North south university
L1. Basic Programming Concepts.pdf
Problem solving using computers - Unit 1 - Study material
computer programming introduction ppt.ppt
Ad

Recently uploaded (20)

PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
Tartificialntelligence_presentation.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
1. Introduction to Computer Programming.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Electronic commerce courselecture one. Pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Encapsulation theory and applications.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
SOPHOS-XG Firewall Administrator PPT.pptx
Tartificialntelligence_presentation.pptx
Assigned Numbers - 2025 - Bluetooth® Document
NewMind AI Weekly Chronicles - August'25-Week II
Spectral efficient network and resource selection model in 5G networks
20250228 LYD VKU AI Blended-Learning.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Group 1 Presentation -Planning and Decision Making .pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation_ Review paper, used for researhc scholars
Building Integrated photovoltaic BIPV_UPV.pdf
1. Introduction to Computer Programming.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Empathic Computing: Creating Shared Understanding
Electronic commerce courselecture one. Pdf
Programs and apps: productivity, graphics, security and other tools
Encapsulation theory and applications.pdf
Big Data Technologies - Introduction.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Ad

Problem Solving PPT Slides Grade 10- 11students

  • 2. What is Problem Solving This is the process that requires a critical analysis of the situation(the problem) and careful consideration of possible ways of over coming the problem (solving).
  • 3. Steps for problem solving ⚫Define the problem ⚫Propose and analyze solution ⚫Determine the most efficient solution ⚫Develop and represent the algorithm ⚫Test and validate the solution.
  • 4. Define the Problem Define the problem means to get a good understanding of the problem to find out what we are supposed to do.
  • 5. Proposes and analyze solution This is the stage where you should concentrate on considering alternative solution to the problem.
  • 6. Determine the most efficient solution In this stage you consider which solution is the best. Both solution can solve the problem. However use the one which is most efficient.
  • 7. Develop and Algorithm Once the solution is selected. It is time to put it in action. It is a systematic procedure to show you how to implement the solution (algorithm). What is an Algorithm An algorithm is a set of instructions that if when followed in a sequence will lead to a solution for the problem. Characteristics of Algorithm 1. Must be precise 4. Must pass the flow of control 2. Must be unambiguous from one process to another. 3. Eventually terminate
  • 8. Test and Validate the solution This is the final step. This is where you see if the problem works in other word if it is solve. One way of test is by using a flow chart.
  • 9. Example 1 Add two number and find their sum
  • 10. Input Process Output Num 1 Num 2 Sum=num1+ num 2 sum solutio n
  • 11. Constants and Variables ⚫Program data are like ingredients in a recipe, must be stored in a suitable container. ⚫Constants is a data item with a name and value that remains the same during the execution of a program . Eg. Pie = 3.14 ⚫ Variable is a named storage area whose contents can be changed.
  • 12. Program Data Constants/variable Proposed variable name Price per hour Constant priceperhour Number of hours Variable numberofhours Total cost Variable totalcost
  • 13. Data types A data type is a classification or category of various data that states the possible values that can be taken, how they are sorted and shat range of operations are allowed on them. Data type Possible values Examples integer Any whole number 0,-27,540 Real Any decimal number 13.5,2.1427, -8.0 Character Any single value D, K, @. # String Multiple characters Frank, jack Boolean Two possible True/false ,
  • 14. Program Data Constants/ variable Proposed variable name Data type Price per hour Constant priceperhour real Number of hours Variable numberofhours Integer Total cost Variable totalcost Integer/real PROGRAM ProgramName (FileList); CONST (* Constant declarations *) TYPE (* Type declarations *) VAR (* Variable declarations *) (* Subprogram definitions *) BEGIN (* Executable statements *) END.
  • 15. What do you want to do Verb to use How to use it Input Input Read Get Input name Get price Read num Output Print Display Write Output Print “sum” Display “sum” Write ”sum” Output ”sum” Processing Age Sum Age = 14 Sum: num1+num2 Decision If, then If x > 20 then Printer x Repetition While While x> 5 do
  • 16. The basic structure of a Pascal program is: PROGRAM ProgramName (FileList); CONST (* Constant declarations *) (not mandatory) VAR (* Variable declarations *) (* Subprogram definitions *) BEGIN (* Executable statements *) END.
  • 17. Read/Readln ⚫The READ and READLN instructions read a variable from the keyboard. The command will continue to read until ENTER is pressed (with an exception). In contrast with READ, READLN reads the variable and, when the user pressed ENTER, it moves the cursor on the next line. ⚫These instructions can read one variable or more variables. For example:
  • 18. Read two numbers and find their sum. Print their sum Algorithm Algorithm Cal Var num1,num2,sum:integer Start Output(‘Please enter a number’) Read(num1) Output(‘Please enter a second number’) Read(num2) sum num1+num2 Output(‘the sum is’, sum) Stop Pascal Program Cal; Var num1,num2,sum:integer; Begin Writeln (‘Please enter a number’); Readln(num1); Writeln(‘Please enter a second number’); Readln(num2); Sum:=num1+num2; Writeln(‘the sum is’, sum); Readln; End.
  • 19. Types of errors ⚫Syntax – are errors in the way we use the programming language. ⚫Logic – are mistake in the design of the program such as a branch to a wrong statement. ⚫Run Time –is a program flaw detected during program execution which may cause the program to terminate abnormally.
  • 20. Using a constant program cal; const a = 5; b = 385.3; Var alpha, beta : real; begin alpha := a + b; beta := b / a ; Writeln('the answer is', alpha , beta); readln; end. Without a constant program cal; Var alpha, beta,a,b : real; begin Writeln('please enter a figure for a'); Readln(a); Writeln('please enter a figure for b'); Readln(b); alpha := a + b; beta := b / a ; Writeln('the answer is', alpha , beta); readln; end.
  • 21. Terms to know ⚫ Low level languages – Generation 1 and 2 ⚫ High level languages – Generation 3 to 5 ⚫ Source code – This is a sequence of statement in a programming language. ⚫ Translator – is a system program that converts a program written in the source code to machine code. ⚫ Compiler- is a system program that processes all the line of code in an entire program. ⚫ Object code – This contains the machine instruction for executable program and is used to create the finish executable program in another process called linking. ⚫Interpreter – is a translator of a high level programming language that translate and run the program at the same time.
  • 22. Write a an array to read ten numbers and calculate their sum. Print sum. Program summm; var num:array[1..2] of integer; sum, x: integer; begin Writeln('Let us write our first array'); for x:= 1 to 2 do begin Writeln('Plese enter a number'); Readln(num[x]); sum:= sum + num[x]; end; Writeln('The sum is',' ',sum); Writeln('Congrats for writings your first array'); end.
  • 23. Write an array to read 10 numbers and print the numbers Program summm; var num:array[1..2] of integer; x: integer; Begin for x:= 1 to 2 do begin Writeln('Plese enter a number'); Readln(num[x]); end; Writeln; Writeln; for x:= 1 to 2 do begin Writeln('The numbers are',' ',num[x]); end; end.
  • 24. Program Counterr; var name:array[1..2] of string; num:array[1..2] of integer; x, y, z: integer; begin y:=0; z:=0; for x:= 1 to 2 do begin Writeln('Cources offered are:'); Writeln ('1 Mathematics'); Writeln ('2 English'); Writeln('Please press 1 for Mathematics and 2 for English'); Readln(num[x]); Writeln('Plese enter you name'); Readln(name[x]); if num[x]= 1 then y:=y+1; if num[x] = 2 then z:=z+1; end; Writeln('Total for Mathematics is',' ', y); Writeln('Total for English is',' ', z); end. Write a program to read the names of students who register for Mathematics and English. Display the number of students for each course.