450 likes | 1.17k Views
Raptor. Mr. Lau Ka Lun Lai King Catholic Secondary School. Introduction. RAPTOR is freely distributed as a service to the CS education community. It was originally developed by and for the US Air Force Academy, Department of Computer Science. It is free software.
E N D
Raptor Mr. Lau Ka Lun Lai King Catholic Secondary School
Introduction • RAPTOR is freely distributed as a service to the CS education community. • It was originally developed by and for the US Air Force Academy, Department of Computer Science. • It is free software. • RAPTOR is a flowchart-based programming environment. • to help students visualize their algorithms and avoid syntactic baggage. • RAPTOR programs are created visually and executed visually by tracing the execution through the flowchart. • Required syntax is kept to a minimum.
Website • http://raptor.martincarlisle.com/
Layout • Mode -> Novice • Run the program • Pause • Stop • Speed of running • Generate source code
Program Structure • When executing a RAPTOR program, you begin at the Start symbol and follow the arrows to execute the program • A RAPTOR program stops executing when the End symbol is reached.
RAPTOR Statements/Symbols • The top four statement types: • Assignment, Call, Input, and Output • The bottom two types: • Selection and Loops
Assignment Statement/Symbol • Variable ← Expression
Examples (cont.) Read_Scores Calculate_Average_Score Print_Those_Above_Average
Sequential Program Control • in sequence • one-after-the-other
Counting Loops Statements to be repeated
Exercises • Write a series of RAPTOR statements that determines if X has the value 1, 2, or 3, and prints out “ONE”, “TWO”, or “THREE” accordingly. • Write a complete program that converts between degrees Fahrenheit and Celsius. The user must first enter the conversion that is desired (F to C or C to F) using any means you want and then enter the value to be converted. The formulas for conversion are: F = 9/5 C + 32 and C = 5/9 (F – 32) • Write a complete program that plays the game of HI-LO. The program asks one user for a number between 1 and 100 and verifies that such a number has been entered. It then asks a second user for a guess and reads it in. If the guess is correct a congratulation message is written to the screen and the program ends. Otherwise the message “HI” or “LOW” is displayed (if the guess is higher or lower) and another guess is asked for and read in.