Please enable JavaScript to use CodeHS

AP Computer Science A (Mocha)

Lesson 2.4 Arithmetic Expressions

Description

This lesson introduces students to writing programs that solve arithmetic expressions in Java. Students will learn about using variables for computation, handling different data types, and understanding potential pitfalls such as round-off errors and integer overflow. The activities are designed to build a strong foundation in arithmetic operations and computational accuracy in Java.


Objective

Students will be able to:

  • Use Java to perform arithmetic operations and evaluate expressions
  • Understand the significance of data types in arithmetic computations
  • Identify and correct errors related to floating-point arithmetic and integer overflow
  • Write programs to solve arithmetic expressions and simple computational problems