The Rogue's
TI-86 BASIC Tutorial
~
Programming Practice for Chapter 2: Input/Output

The following is a short program that you can enter into your calculator. It demonstrates the uses of all the commands that you have learned in chapter 2. Note: Everything in green are comments. Do not type comments into your calculator; they just let you know what a command is doing.

Program: "HELLO"

:ClLCD    Clear the Screen
:Disp "Hi! I'm a TI-86 calc-","ulator. What's your"    Display a string on the screen
:InpSt "name? ",NAME    Lets the user type a string and stores it to the variable "NAME"
:ClLCD
:Disp "And how old are you?"
:Input "",AGE    Lets the user enter a number and stores it to variable "AGE"
:ClLCD
:Disp "What are your","favorite numbers?"
:Prompt A,B    Lets the user enter two numbers and stores them to variables "A" and "B"
:ClLCD
:Disp "Nice to meet you,",""    Displays some text followed by an empty line
:Outpt(2,1,NAME+"!"    Shows the user's name on row 2, column 1 with a "!" after it
:Disp "Your age is:"    Because the Disp command two lines up skipped a line, the text from this Disp command appears on the line AFTER the Outpt( command
:Outpt(3,13,AGE
:Disp "Your favorite #'s:",A,B    Displays some text, followed by the #'s that the user entered


This is a screenshot of the program in action:
Chapter 2 Program: HELLO


Please close this popup window when you are finished to return to Chapter 2