Algorithms and calculators
Season 1
Episode AP07 Time frame 1 period
Prerequisites :
ConeptandexamplesofalgorithmsObjectives :
•
Disover howalgorithmsan beimplemented with a alulator.Materials :
•
Calulators.•
Slideshow.•
Task sheet.1 – Programming 55 mins
Pupils workby pairs.They havetoimplementsome algorithmswiththeir alulatorand
understand how the programminglanguageworks.
Algorithms and calculators
Season 1 Episode AP07 Document TI
Creating, Editing, Executing
Create a new program prgm > NEW >1 :Create New
Name the program Alpha mode is automati.
Edit anexisting program prgm >EDIT > Choose the program
Exeute a program prgm > EXEC> Choose the program
Programming instructions
Assignment instrution
→
Key sto→
Input/Outputinstrutions prgm > I/O
Conditionalinstrutions prgm > CTL
Loop instrutions prgm > CTL
Relations, logic and lists
Relations (
=
,<
) 2nde + math > TESTLogialoperators (and, or) 2nde + math > LOGIC
Listsnames 2nde + Keys 1 to6
Algorithms and calculators
Document CASIO
Creating, Editing, Executing
Createa new program PRGM Menu > F3 NEW
Name the program Alpha mode is automati.
Edit an existing program PRGMMenu > Choose the program> F2 EDIT
Exeute a program PRGM Menu >Choose the program> F1 EXE
Programming instructions
Assignmentinstrution
→
Key→
Input/Outputinstrutions SHIFT + VARS > F4 ? or F5
Separator in aline SHIFT +VARS > F6 > F1 :
Conditionalinstrutions SHIFT + VARS > F1 COM
Loop instrutions SHIFT + VARS > F1 COM > F6 (one ortwie)
Relations, logic and lists
Relations(
=
,<
) SHIFT + VARS > F6 > F6 > F4 LOGICLogial operators(and, or) fboxOPTN > F6 > F3 REL
Algorithms and calculators
Season 1
Episode AP07
Document CASIO Task sheet
Algorithm # 1
Algorithm Implementation
begin
Input :
A
,B A ← A + B
;B ← A − B
;A ← A − B
;Output :
A
,B
end
?
→
A?
→
BA+B
→
AA-B
→
BA-B
→
AA=:A
B=:B
1
. Copy the programin your alulator, namingit SWITCHAB.2
. Exeute the programand llout the table below.Input
A = 5
,B = 3 A = − 2
,B = 1 A = − 70
,B = 42
Output
Algorithm # 2
Algorithm Implementation
?
→
A?
→
BA+B
→
CA-B
→
DC=:C
D=:D
1
. Copy the programin your alulator, namingit SUMDIFF.2
. Exeute the programand llout the table below.Input
A = 5
,B = 3 A = − 2
,B = 1 A = 70
,B = 42
Output
3
. What seems to be the purpose of this algorithm?4
. Intheemptyspaeabove,writethealgorithminEnglishwiththeusualpresentation.Algorithm # 3
Algorithm Implementation
begin
Input :
x
if
x > 0
thenOutput :
x
else
Output :
− x
endif
end
?
→
XIf X<0:Then -X
→
X:IfEndX
1
. Copy the programin your alulator, namingit ABSVAL.2
. Exeute the programand llout the table belowInput 17
− 5 − 1 . 8 15 / 7 − π
Output
3
. Wewantto modifythe algorithmso thatitwillompute thesquare of any positiveinput and the opposite of the square of any negative input. Write down below the
new algorithmand how youwould implement itwith your alulator.
Algorithm Implementation
4
. Copy the new program inyour alulator, namingit ALGSQUARE.5
. Exeute the programand llout the table belowInput 6
− 5 − 11 √
2 − √
5
Algorithms and calculators
Season 1
Episode AP07 Document TI Task sheet
Algorithm # 1
Algorithm Implementation
begin
Input :
A
,B A ← A + B
;B ← A − B
;A ← A − B
;Output :
A
,B
end
:Prompt A
:Prompt B
:A+B
→
A:A-B
→
B:A-B
→
A:Disp A,B
1
. Copy the programin your alulator, namingit SWITCHAB.2
. Exeute the programand llout the table below.Input
A = 5
,B = 3 A = − 2
,B = 1 A = − 70
,B = 42
Output
Algorithm # 2
Algorithm Implementation
:Prompt A
:Prompt B
:A+B
→
C:A-B
→
D:Disp C,D
1
. Copy the programin your alulator, namingit SUMDIFF.2
. Exeute the programand llout the table below.Input
A = 5
,B = 3 A = − 2
,B = 1 A = 70
,B = 42
Output
3
. What seems to be the purpose of this algorithm?4
. Intheemptyspaeabove,writethealgorithminEnglishwiththeusualpresentation.Algorithm # 3
Algorithm Implementation
begin
Input :
x
;if
x > 0
thenOutput :
x
else
Output :
− x
endif
end
:Prompt X
:If X<0
:Then
:-X
→
X:End
:Disp X
1
. Copy the programin your alulator, namingit ABSVAL.2
. Exeute the programand llout the table belowInput 17
− 5 − 1 . 8 15 / 7 − π
Output
3
. Wewantto modifythe algorithmso thatitwillompute thesquare of any positiveinput and the opposite of the square of any negative input. Write down below the
new algorithmand how youwould implement itwith your alulator.
Algorithm Implementation
4
. Copy the new program inyour alulator, namingit ALGSQUARE.5
. Exeute the programand llout the table belowInput 6