Question: 2. (6 points) Determine if there is an error in each of the following program segments. If there is an error, specify whether it

 2. (6 points) Determine if there is an error in each of  

2. (6 points) Determine if there is an error in each of the following program segments. If there is an error, specify whether it is a logic error or a compilation error, circle the error in the program and write the corrected code in the space provided after each problem. If the code does not contain an error, write "no error." [Note: There may be more than one error in each program segment.] a. public int maximum ( int x, int y, int z ) { int max = x; if (y > max ) max = y; if (z > max ) | max = z; return max; } b. Random generator = new Random () ; for (int i = 1; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a There are several errors in the given code segment 1 Compilation Error The variab... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!