Page 1 :
Thursday, May 20, 2021, 8:17 PM, , import java.util.*;, class rect, {, public static void main(), {, Scanner sc=new Scanner(System.in);, int ch,l,b;, System.out.println("1.Area");, System.out.println("2.Perimeter");, System.out.println("3.Diagonal");, System.out.println("Enter choice");, ch=sc.nextInt();, System.out.println("Enter length & breath");, l=sc.nextInt();, b=sc.nextInt();, if(ch==1), System.out.println("Area="+(l*b));, else if(ch==2), System.out.println("Perimeter="+2*(l+b));, else if(ch==3), System.out.println("Diagonal="+Math.sqrt(l*l+b*b));, else, System.out.println("Invalid choice");, }, }, , import java.util.*;, class calculator, {, public static void main(), {, Scanner sc=new Scanner(System.in);, int a,b;, , COMBINED ICSE 246 Page 1
Page 4 :
Evaluate the following expression if the value ofx=2,y=3 and z=1. [2], v=x+ –z+y+ + +y, , What is the value of y after evaluating the expression given below ?, y + = + +y+y– - –y; when int y=8, , COMBINED ICSE 246 Page 4
Page 5 :
Format the following if statements with, indentation:, i. if (x == y) if (x == z) x = 1; else y = 1; else z = 1;, , Write statement to find the smallest of the three given integers using the min(), method of the Math class., , Rewrite the following statement using if else:, int max=215, min=323;, String str= (max>min) ? "Max is greater than Min" : "Min is Greater than Max";, , COMBINED ICSE 246 Page 5
Page 6 :
Question 16:, Write a program in Java to read three integers and display them in descending, order., , Write a program in Java to accept three numbers and check whether they are, Pythagorean Triplet or not. The program must display the message accordingly., [Hint: h2=p2+b2], , Question 21:, Star mall is offering discount on various types of products purchased by its customers., Following table shows different type of products and their respective code along with the, discount offered. Based on the code entered, amount entered, the mall is calculating the, total amount after deducting the availed discount. Create a program to calculate total, amount to be paid by the customer., Item, Laptop, LCD, XBox, Printer, , Item Code, L, D, X, P, , Discount, 5%, 7%, 10%, 11%, , Question 22:, , COMBINED ICSE 246 Page 6
Page 7 :
The City Library charges late fine from members if the books were not returned on, time as per the following table:, Number of days late, Up to 5 days, 6 to 10 days, 11 to 15 days, 16 to 20 days, More than 20 days, , Magazines fine per day Text books fine per day, Rs. 1, Rs. 2, Rs. 2, Rs. 3, Rs. 3, Rs. 4, Rs. 5, Rs. 6, Rs. 6, Rs. 7, , Using the statement, write a program in Java to input name of person, number of, days late and type of book — 'M' for Magazine and 'T' for Text book. Compute the, total fine and display it along with the name of the person., , COMBINED ICSE 246 Page 7