Teacher Powerpoint
Teacher Powerpoint
PROGRAMMING
SYNTAX
&
LOGIC
in
PA S C A L
TODAYS OBJECTIVES
Activity 1
Students Record Card
First Name: __________________________
Address: _____________________________
Scenario:
Your school has finally decided to computerise the schools form one registration process.
They have decided to enlist this task to the form 4 IT students. You have been asked to
create a program that will enter the relevant information that is needed for this registration.
This must be ready in time for the next registration period. Above shows an example of
some information on a students record card.
Write an algorithm / pseudodode based on the example of the students record card.
Activity 1
Students Record Card
First Name: __________________________
Last Name: ___________________
Address : _____________________________ Contact No: _______________
Algorithm
1.
2.
3.
4.
5.
START
Enter Students First and Last Name.
Input Address.
Accept Contact No
STOP
Activity 1
4.
5.
6.
7.
8.
PROGRAM title;
VAR
BEGIN
Write;
Read;
END.
Activity 2
Answers
1. This command displays text on the screen.
WRITE/WRITELN
2. This command accepts input from the user.
READ /
READLN
3. A program in Pascal must start with what reserved word.
PROGRAM
4. A program must end with what reserve word.
END
VAR
Activity 3
Working in Pairs
Write a program using PASCAL that accepts input from the user in
order to fill in the relevant information based on the scenario in Activity
1. Your school has indicated that the program should include your
mother name and reprint the address you entered previously as
Address: . This additional information is required to be on the
Students record card. Use the new coding language structure you have
just learnt.
Time to complete activity 10 mins
Activity 1
1. Start
2. Print Enter
students first and
last name
3. Input Fname,
Lname
4. Print Enter
address
5. Input Address
6. Print Enter
Telephone No.
7. Input Tele
Activity 3
Program registration;
Var
Fname, Lname, Address, Tele, Mname:
string;
Begin {main prog} (1)
Write(Enter students first and last
name); (2)
Readln (Fname, Lname); (3)
Writeln(Enter address); (4)
Readln(Address); (5)
Writeln(Enter contact no: ); (6)
Read(tele); (7)
Writeln(Enter mother name: ); ( *)
Read(Mname); (*)
Writeln (Address: , address);
(Reprint 5)
End. {main prog} ( 8)
THE END
THANK YOU !!