February 2014
Beginner
1248 pages
62h 25m
English
The assignments (in lines 13–14) initialize total to 0 and gradeCounter to 1. These initializations occur before the variables are used in calculations.
Common Programming Error 4.3
Using the value of a local variable before it’s initialized results in a compilation error. All local variables must be initialized before their values are used in expressions.
Error-Prevention Tip 4.3
Initialize each total and counter, either in its declaration or in an assignment statement. ...
Read now
Unlock full access