Posts

NPTEL JAVA WEEK 02 ASSIGNMENT SOLUTION

Image
   WEEK 02 SOLUTIONS WITH PROOF OF COMPILATION. QUESTION NO 1=  C all the method  print()  of class Student first and then call print() method of class School? ANSWER NO 1 = // Create an object of class Student Student stu = new Student(); // Call 'print()' method of class Student  stu.print(); // Create an object of class School School sch = new School(); // Call 'print()' method of class School sch.print(); PROOF=

NPTEL JAVA WEEK 01 ASSIGNMENT SOLUTION

Image
 WEEK 01 SOLUTIONS WITH PROOF OF COMPILATION. QUESTION 1=  Complete the code segment  to find the perimeter and area of a circle given a value of radius ? . ANSWER    if(radius>0)  { area=Math.PI * radius * radius; perimeter=2 * Math.PI * radius; System.out.println(perimeter); System.out.println(area);}   else{       System.out.print("please enter non zero positive number");  } PROOF OF PASSING = QUESTION NO 2 = TO  find the largest among three numbers x,y, and z?                                              ANSWER        if( x > y && x > z) { result = x; } else if( y > x && y > z) { result = y; } else if( z > y && z > x) { result = z; } else { result = x; } System.out.print(result);    ...