Please enable JavaScript to use CodeHS

Ciencias de la computación, Nivel A (Nitro)

Lesson 1.5 Datos de entrada de usuario

Description

En esta lección, los estudiantes aprenderán cómo recibir datos introducidos por el usuario con la clase de Scanner en Java. Después de crear un nuevo objeto tipo Scanner, aprenderán los siguientes comandos, los cuales les permitirán tomar datos desde el usuario.

String name = input.nextLine();
int number = input.nextInt();
double decimal = input.nextDouble();

Objective

Students will be able to:

  • import and initialize a new Scanner to take in user input
  • create variables that take the assigned value of the user input.
  • choose the correct command that will allow the program to receive the input value that corresponds with its desired data type

Enduring Understandings

This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that…

  • EU (Var-1) To find specific solutions to generalizable problems, programmers include variables in their code so that the same algorithm runs using different input values. (LOs 1.A, 1.B)