Sharp EL-5230, EL-5250 Application Examples, Programming Examples, Temp Normal Program?, Chapter

Models: EL-5230 EL-5250

1 132
Download 132 pages 32.97 Kb
Page 89
Image 89
Application Examples

Chapter 8

Application Examples

Programming Examples

The following examples demonstrate the basic use of programming commands including print, input and flow controls. Use the examples for your programming reference.

Some like it hot (Celsius-Fahrenheit conversion)

This is a program to convert temperatures from Celsius to Fahrenheit and vice versa.

1.Press b 2 1 0 to open a window for creating a NEW program.

2.Type TEMP for the program title then press e.

A NEW program called ‘TEMP’ will be created.

3.Enter the program as follows.

See ‘*’ below for further explanation.

TEMP :NORMALProgramming ExamplesSome like it hot (Celsius-Fahrenheit conversion)TEMP :NORMAL PROGRAM? PROGRAM? Manual backgroundManual backgroundManual background

Program code

Key operations

Label START

i 6 @ a START ;

 

e

 

 

 

 

Print”(1) C TO F

i 1

( 1 ) @ a

 

s C s TO s F ; e

 

 

 

Print”(2) F TO C

i 1

( 2 ) @ a

 

s F s TO s C ; e

 

 

 

Input T

i 2

; T e

*Here, the program prompts you to choose which type of conversion you wish to perform. Press 1for “C TO F” and 2for “F TO C”.

87

Page 89
Image 89
Sharp EL-5230, EL-5250 Application Examples, Programming Examples, Some like it hot Celsius-Fahrenheit conversion, Chapter