5.1

Identify the error in the following program

Answer

Void setvalue (in w, int l) function must be public.

5.2

Identify the error in the following program

Answer

Void setvalue (int w, int l) function must be public.

5.3

Identify the error in the following program

Answer

Note: All other code remain unchanged.

5.4

Identify the error in the following program

Answer

setCount ( ) is a void argument type, so here obj1.setCount (5); replace with obj1.setcount( );

5.5

Identify the error in the following program

Answer

Just write the main function like this:

5.6

Identify the error in the following program

Answer

Undefined structure Room in main ( ) function.
Correction : Change the main ( ) Function as follow:

 


Next Previous