Please enable JavaScript to use CodeHS

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

Lesson 1.6 Cambios de Valor y Rangos de Variables

Description

En esta lección, los estudiantes aprenderán cómo cambiar el tipo de datos de un valor a través del proceso de moldeado. También utilizarán el moldeado para ayudar a redondear los valores duplicados al entero más cercano. Los estudiantes explorarán el rango de variables permitidas en Java y comprenderán el desbordamiento de enteros cuando se intente usar un valor fuera de este rango. Esta lección corresponde al tema 1.5 de Programación Avanzada de Ciencias Computacionales.


Objective

Students will be able to:

  • Evaluate arithmetic expressions that use casting
  • Understand that integer values in Java are stored using a finite amount (4 bytes) of memory. Therefore, an int value must be in the range from Integer.MIN_VALUE to Integer.MAX_ VALUE inclusive
  • Understand when an expression evaluates to an int value outside of the allowed range, an integer overflow occurs
  • Recognize and use implicit casting
  • Use casting to round to the nearest integer