Ask for numbers with Prompt and Input
Write programs that ask for values while they run and then Disp a result.
Prompt asks for one or more variables by name (L=?), one after the other. Input does the same for one variable but lets you choose the question text.
Both are on the I/O tab of PRGM while you are in the editor. Type the answer and press ENTER, and the program carries on.
Classic Graphing 84 · Prompt: area of a rectangle
Start on the main screen: Press 2nd then mode (QUIT) to get back to the home screen. Pressing clear on a menu also backs out of it.
Create a program called AREA: PRGM, left arrow, 1, then A, R, E, A and ENTER.
prgm◀1math×sinmathenterFirst line, Prompt L,W: PRGM, right arrow, 2 (Prompt), then ALPHA, ) for L, a comma, ALPHA, − for W. Press ENTER.
prgm▶2alphaL),alphaW−enterSecond line, Disp L*W: PRGM, right arrow, 3 (Disp), L, ×, W.
prgm▶3alphaL)×alphaW−Quit the editor (2nd, MODE) and run the program with PRGM, 1, ENTER.
2ndQUITmodeprgm1enterAt L=? type 3 and press ENTER. At W=? type 4 and press ENTER.
3enter4enter
You should seeThe area 12 is shown.
Classic Graphing 84 · Input with your own question
Start on the main screen: Press 2nd then mode (QUIT) to get back to the home screen. Pressing clear on a menu also backs out of it.
Create a program called SQ: PRGM, left arrow, 1, then S (LN) and Q (9) and ENTER.
prgm◀1ln9enterPaste Input from PRGM, right arrow, 1. Lock letters (2nd, ALPHA) and type the question "SIDE " with a space (ALPHA 0) before the closing quote. Press ALPHA to unlock.
prgm▶12ndA-LOCKalpha+lnx²x⁻¹sin0+alphaAdd a comma and the variable S (ALPHA, LN), then ENTER.
,alphaSlnenterSecond line, Disp S²: PRGM, right arrow, 3, then S and the x² key.
prgm▶3alphaSlnx²Quit, run it, and answer 5.
2ndQUITmodeprgm1enter5enter
You should seeThe square of 5, 25, is shown.
Tips
- You can answer with an expression, such as 2+3, or a negative number using the (−) key.
- Prompt A,B,C asks three questions in a row, which is handy for formulas such as the quadratic formula.
Related guides
- Create your first program with NEWMake a program called HELLO that shows a message, then run it from the EXEC tab.
- Make decisions with If, Then and ElseWrite a program that tells you whether a number is negative, using If, Then, Else and End.
- Programs on the Classic Graphing 84Where programs live on the Classic Graphing 84, and how to create, edit, run and stop them.