Chapter 2. Communication: basic input and output

 

This chapter covers

  • Using the program editor to write programs
  • Using the homescreen as a canvas for input and output
  • Displaying text and numbers on the homescreen
  • Using numbers and text typed by the user in programs

An important part of any program is interacting with the user. For almost any program or game you might want to create, you’ll need to accept numbers, strings, or input from the user, display or draw output back to the user, or both. This chapter will teach you how to get strings and numbers from the user and write strings and numbers back.

As you learned in chapter 1, your calculator shares its architecture with any common computer. You may recall that calculators and computers both have connected devices called input and output devices, as shown in figure 2.1. For computers, things like the monitor, the speakers, and the printer are the output. They’re devices the computer can instruct to communicate something to the user. Computers’ input devices, such as the keyboard, the mouse, and a microphone, let the user talk back to a computer. In much the same way, calculators have input and output devices for communication with the user: the keypad gives the user a way to instruct the calculator; the LCD screen lets the calculator show things back to the user.

Figure 2.1. The input and output devices of a computer (left) and a calculator (right), excerpted from figure 1.2

2.1. Getting to know the program editor and homescreen

 

2.2. Output: displaying text

 
 
 

2.3. Input from users: the Prompt and Input commands

 
 
 
 

2.4. Troubleshooting tips

 

2.5. Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage