Monthly Archives: December 2019
Question 7
Design a class RailwayTicket with following description: Continue reading
Question 6
Define a class taximeter having the following description: Continue reading
Question 5
Design a CLASS to overload a function sum( ) as follows: Continue reading
Question 4
(i) Write a function to print the Floyds triangle with N rows Example: If N = 5, Output: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 … Continue reading
Question 3
a) Write the output int x=0; do { if(x<3) { x+=2; System.out.println(x); continue; } else { System.out.println(++x); break; } } while(x<10); b) Write the output class box { int width; int height; int length; int volume; void volume(int height, int … Continue reading
Question 2
Rewrite the following if else if construct into switch case if( var==1) System.out.println(“good”); else if(var==2) System.out.println(“better”); else if(var==3) System.out.println(“best”); else System.out.println(“invalid”); 2. Rewrite the following loop using for loop: while (true) … Continue reading