Uploaded by Shebece Patt

Lesson 1

advertisement
ESCUELA SECUNDARIA TECNICA MEXICO
INFORMATION TECHNOLOGY COURSE PACKAGE
4th Form (4-4/4-5/4-6)
Week 1(5th October- 9th October 2020)
Lesson 1
Algorithm: a process or set of rules to be followed in (a sequential order) calculations or
other problem-solving operations, especially by a computer.
Example 1.
Write an algorithm to input a time. If time is, 11:00 then display “Ring the Bell”.
Begin
Print “Enter a time”
Read Time
If time = 11:00 then
Print “Ring the Bell”
Endif
Input
Processing/decision
End.
Variable is Time (variable name)
Condition If (Decision) one way only, most be true in order to execute results. In this
case only when using IF THEN statement.
ESCUELA SECUNDARIA TECNICA MEXICO
INFORMATION TECHNOLOGY COURSE PACKAGE
4th Form (4-4/4-5/4-6)
Example 2.
Write an algorithm to read a vehicle. If the vehicle is a car you are to display the
message “Love it”.
Begin
Print “ Enter name of vehicle”
Read Veh
If veh = car then
Print “ Love It”
Endif
End.
Points to remember in an If condition, that when an if statement is executed then it most
be closed with an Endif and it is before the final End. This End closes the entire
algorithm.
Activity 1
Write an algorithm to read the weather; if the weather is sunny
output “Good day for the beach’.
Download