1.12 Code Examples & Exercises
Introduction
This closing topic consolidates Chapter 1: variables, data types, operators, strings, control flow, wrapper classes, and arrays working together in complete, runnable programs — the same way they combine in real code.
Key Concepts
Code Examples
This program combines an array, a for-each loop, if/else-if branching, and mixed-type arithmetic (`(double) total / scores.length` avoids integer-division truncation) into one working example.