Skip Top Navigation Bar

Console Input and Output

Overview

In this lesson, students will learn how to accept input from a user and produce console output.

Learning Objectives

Skills

Student Outcomes

Students will be able to:

Duration: 1 class period

Resources

Warm-up / Motivate

Have students look at their favorite app on their phone. If allowed, have them use it for a few minutes or have them think about what it takes to use it.

Learn

Either as a group or on their own, have students review tutorial: Learn: Introduction to Console Input and Output

Debrief: Take time to answer any questions that students might have. Review their answers to the guiding questions provided.

Practice

**Pair Programming** is a technique that students can use to collaboratively write a program. With pair programming, students take one of two roles: driver or programmer. The driver does not touch the keyboard, but tells the programmer what to write. The programmer is at the keyboard, writing the code provided by the driver. If the programmer disagrees with the driver they are to discuss and come up with a solution. After a specified amount of time (10 - 20 minutes), students switch roles.

Have students complete the practice using the Pair Programming technique: Practice: Reading and Writing Console Input and Output.

Apply

Have students complete the mini-lab exercises: Mini-Labs: Input and Output to the Console

Wrap-up / Extension

Have students write a short program where they take in the number of hours worked and the program tells them their pay if they get paid $8 an hour. Ask students to do some planning by answering these questions:

Once they have a plan, they should put the code into the IDE and run it.

Extension Have students modify the program to obtain the pay rate from the user as well.

Next Lesson

Lesson Plan: Formatting Output and Text Blocks