ICSE Computer Application - Class X - Selection Examination - 2024-25 - MCQ - CALCUTTA PUBLIC SCHOOL
☰Fullscreen
Table of Content:
- Question 1: Write the following lava Expression :- \[ z = x^3 + y^2 - \sqrt{xy} \]
- Question 2: Rewrite the following code using switch case statement
if (value == 1) { System.out.println("1st division"); } else if (value == 2) { System.out.println("2nd division"); } else if (value == 3) { System.out.println("3rd division"); } else { System.out.println("Wrong choice"); } - Question 3: c) If a=24, b=15. find the value of a+=b++ * 5/a++ +b
- Question 4: Write the output of the following code :-
String x; String str = "INFORMATION"; x = str.concat("PRACTICE"); System.out.println(x.length()); System.out.println(x.toUpperCase()); - Question 5: Differentiate between the following code fragments and also give their output :-
int f = 1, i = 2; while (++i < 5) f *= i; System.out.println(f);
int f = 1, i = 2; do { f *= i; } while (++i < 5); System.out.println(f); - Question 6: Convert the following segment into an equivalent do- while loop.
int a, b; for (a = 10, b = 20; b >= 10; b = b - 2) { a++; } - Question 7: What will be the output of the following program segment?
int ar[] = {1, 2, 3, 4, 5}; int a = 1; for (int i = 0; i < 7; i++) { a = a + i * ar[i]; } System.out.println(a); - Question 8: What will be the output of the following program segment?
int a[] = {1, 2, 3, 4, 5, 6, 7, 9, 13, 16}; x = Math.pow(a[4], a[2]); y = Math.sqrt(a[6] + a[7]); - Question 9:
i) Ramesh is trying to write a program to check whether a number is palindrome or not. Due to confusion in the syntax of some of the statements. he could not complete the program and has left some places blank marked with ?1?, ?2?, ?3? and ?4? to be filled with expression function. The incomplete program is shown below:
Based on the above discussion. answer the following questions :-
a) What expression will be filled in place of ?1?
b) What expression will be filled in place of ?2?
c) What expression will be filled in place of ?3?
d) What expression will be filled in place of ?4?
import java.util.*; class Palindrome { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int copy, n, rev = 0; System.out.println("Enter the number"); n = sc.nextInt(); copy = n; while (n != 0) { int r = ?1?; // Place 1 rev = ?2?; // Place 2 n = ?3?; // Place 3 } if (?4?) { // Place 4 System.out.println("Palindrome"); } else { System.out.println("Not palindrome"); } } }