Programming and Problem Solving with Java

(やまだぃちぅ) #1

728


c. intsum = 0 ;
for(intindex = 0 ; index < count.length; count++)
sum = sum + count[index];
9.

11.


  1. a. class containing class objects
    b.class
    c. class
    d.array of class objects
    e.array of primitive values
    f. array of class objects containing class objects
    g.array of class objects
    16.The default value of the component type


Chapter 10 Programming Warm-Up Exercises
2.public voidsetFailing()
{
for(intindex = 0 ; index < failing.length; index++)
if(score[index] < 60 )
failing[index] = true;
}
3.public voidsetPassing()
{
for(int index = 0 ; index < passing.length; index++)
if(score[index] >= 60 )
passing[index] = true;
}
6.public intscoreCt(intgrade)
{
intcount = 0 ;
for(intindex = 0 ; index < score.length; index++)
if(score[index] >= grade)
count++;
returncount;
}

[0] [1] [2] [3] [4] [5] [6] [7]

0 101 2 103 4 105 6 107

[0] [1] [2] [3] [4] [5] [6] [7]

10 9 8 7 6 5 4 3
Free download pdf