< High School Mathematics Extensions < Mathematical Programming

Explanation

The first sample program was developed in three steps: Code for receiving commands. Code for giving output. An example of how to add an additional command and output.

This program will be developed in two steps. The first step will establish the commands we want to handle, and the second step will execute these commands. When we develop longer programs we may iterate through the input and output development process several times. The input process always has to come first, although may be implicit. If a program just does one thing than the command that caused the program to run is the input.

When we run the program below we are telling it to ask us what we want. It does this by displaying these choices:


Key Action
/ Display r/l.
% Display r%l.
= Display r=value l=value.
r Set the value for r.
l Set the value for l.
x End program.


We will review how to output these choices, and will then look at the code for displaying the results.

Next Steps

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.