Practice Input/Output in CS Thinking

Use these practice problems to test your method after reviewing the concept explanation and worked examples.

Quick Recap

The mechanisms by which a program receives data from the outside world (input) and sends results back (output).

What goes in and what comes out. Keyboard โ†’ program โ†’ screen.

Example 1

easy
Identify the inputs and outputs in this program: name = INPUT('What is your name?'). age = INPUT('How old are you?'). OUTPUT 'Hello ' + name + ', you are ' + age + '.'

Example 2

medium
A temperature converter takes a Celsius value as input and outputs the Fahrenheit equivalent. Write pseudocode and identify the input, process, and output.

Example 3

medium
A program reads a list of 5 test scores and outputs the average. Identify the inputs, process, and output. What type of validation might you add to the input?

Example 4

hard
Describe three different input devices and three different output devices a computer program might use. For each, give an example of a program that uses it.