Professional Documents
Culture Documents
Computers in Mathematics
Computers in Mathematics
MATHEMATICS
(SENIOR SECONDARY)
PRESENTATION BY
CHIPESHA .D (KAPTECH) DATA
ALGORITHMS AND FLOWCHARTS
4.
Used for an action , a process or to enter formulas.
.
EXAMPLE
1. Study the flowchart and answer the questions that follow: SOLUTION
55 0.55 2
2100 0.21 4
C=1
1 0.1 1
INPUT N
yes
N= STOP
OUTPUT C
no
C = C+1
EXERCISE
1. Study the flow chart below and complete the table that it is given.
Start
48 0.48 2
- 800 - 80 1
X=
IS
OUTPUT STOP
x<1 ?
S
S = S+1
EXERCISE 2
1. The flow chart below is used to determine whether a particular year is a leap
year or not. Use it to determine whether the following years where leap years.
a) 1964
b) 1970
c) 2018
d) 2020
START
solutions….
GET A
YEAR
a) 1964 – It is a leap
year IS IT No
DIVISIBLE
b) (b) 1970 not aleap BY 4?
year Yes
Yes
LEAP
STOP
YEAR.
PSEUDO CODES
• A pseudo code is a programme design language that is made up of statements that are
written in natural language. It is structured English that is used as an alternative method
to flow charts. There are three structures that can be used :
i. Structures consisting of simple steps that are carried out one after another without
loops or decision boxes.
ii. One which has decision structures. Decision structures occur when a question is asked
the answer ( yes\no). In this case the words like If, Then , Set and End are used.
iii. Loops structures are used when actions are repeated for a number of steps , words to
use are DO UNTIL, DO WHILE etc.
EXAMPLE
1. Draw a corresponding flow chart for the programme below in form of a
pseudo code.
Continued….
•
Begin
Enter radius < 0
then display “ error message “
and re-enter positive radius
enter height
If height < 0
then display ‘’ error message’’
and re-enter positive radius
else volume = * square radius * height
end if
Display volume
End
SOLUTION
BEGIN
Enter
radius
YES
Display error is Height< 0?
message and
re-enter No
positive V = * square radius * height
thought
Display
volume
END
EXERCISE
• Draw a corresponding flow chart for the programme below in form of a pseudo
1.
code.
Start
Enter diameter
If diameter < 0 then display error message and stop
Circumference = * diameter
End if
Display circumference
Stop
SOLUTION
START
ENTER
DIAMETE
R
No
C = * diameter
DISPLAY
CIRCUMFERENCE STOP
EXERCISE 2
• Construct a flow chart to calculate the area of a circle.
SOLUTION
Begin.
ENTER r
Yes Display
IS r ≤ 0? error
message
No
A = * square radius
DISPLAY A
Stop
WRITING A PSEUDO CODE
• A pseudo code is a derivative of a flow chart and only words are used to write a
pseudo code. Each and every flow chart has its representative pseudo code.
EXAMPLES
1. The programmes below are given in form of flow charts. Write down pseudo
codes corresponding to each of the given flow charts.
START
ENTER a , b
No
SET X =
DISPLAY x
STOP
START
ENTER a , r
No Display
Is |r| less
error
than < 1?
message
YES
S∞ =
Display sum
to infinity
STOP
•a. Start
enter a , b
if a = 0, display error message and stop
else, set X=
End if
Display x
Stop
b. Start
enter a, r
if |r| ≥ 1, display error message and stop
else if |r| < 1, then
Set ∞ =
End if
Display sum to infinity
Stop
EXERCISE
DISPLAY ENTER
ERROR HEIGHT
MESSAGE
AND RE-
ENTER
POSITIVE YES IS HEIGHT
HEIGHT < 0?
START
X1 =
Enter a ,b , c
X2 =
D = b*b - 4*a*c
Print x1 and x2
YES Display
Is D<0? no
STOP
solution
NO
SOLUTIONS
•1. Start
enter radius
if radius < 0 display error message and re-enter positive radius .
else, enter height < 0 display error message and re-enter positive radius
then set V = ** square radius * height
display volume
stop
•
2. Start
enter a , b and c
set D = b*b – 4 * a * c
if d < 0, display no solution and stop
else, set X1 = , X2 =
end if
Print X1 and X2
stop
THE END!
Thank you for your Attention.