go to previous page   go to home page   go to next page hear noise

Is your car's computer doing input and output?

Answer:

Yes—data is input from sensors, computations are performed, and the results are output to devices that control the motor.


I/O Streams

IO streams

If your car's program were written in Java, it would use a specialized I/O package that manages sensors and controllers. It would not use the I/O package that deals with keyboards and terminals.

In Java, a source of input data is called an input stream and the output data is called an output stream.

In the picture, each "O" represents a piece of data waiting in line to be input or leaving as output.

Data input is called reading data, and data output data is called writing data (or printing data if the output stream is connected to a monitor or a printer.)

The input stream is like a string of pearls which the program inputs one at a time, in order. The output stream is another string of pearls (not usually the same pearls as were read in). Often a program will read several data and then combine them somehow to produce one output value. For example, the input data might be a list of numbers, the output data might be their sum.


QUESTION 3:

If the program is a text editor (like Notepad) what are the input and output data?