ICSE Computer Application - Class X - 2012 PYQ
☰Fullscreen
Table of Content:
- Question 1: Give one example each of a primitive data type and a composite data type.
- Question 2: State the values of n and ch.
char c = 'A'; int n = c + 1; char ch = (char)n; - Question 3: What will be the result stored in x after evaluating the following expression?
int x = 4; x += (x++) + (++x) + x; - Question 4: Give output of the following program segment:
double x = 2.9, y = 2.5; System.out.println(Math.min(Math.floor(x), y)); System.out.println(Math.max(Math.ceil(x), y)); - Question 5: State the output of the following program segment:
String s = "Examination"; int n = s.length(); System.out.println(s.startsWith(s.substring(5, n))); System.out.println(s.charAt(2) == s.charAt(6)); - Question 6:
State the method that:
- Converts a string to a primitive float data type.
- Determines if the specified character is an uppercase character.
- Question 7: State the data type and values of a and b after the following segment is executed:
String s1 = "Computer", s2 = "Applications" a = (s1.compareTo(s2)); b = (s1.equals(s2)); - Question 8: What will the following code output:
String s = "malayalam"; System.out.println(s.indexOf('m')); System.out.println(s.lastIndexOf('m')); - Question 9: Rewrite the following program segment using while instead of for statement.
int f = 1, i; for(i = 1; i <= 5; i++){ f *= i; System.out.println(f); } - Question 10: What are the values of x and y when the following statements are executed?
int a = 63, b = 36; boolean x = (a > b)? true : false; int y = (a < b)? a : b; - Question 11: Differentiate between public and private modifiers for members of a class.
- Question 12: Give one point of difference between unary and binary operators.
- Question 13: Differentiate between call by value or pass by value and call by reference or pass by reference. Java Language
- Question 14: Write a Java expression for √(2as + u²).
- Question 15:
Name the type of error (syntax, runtime or logical error) in each case given below:
- Division by a variable that contains a value of zero.
- Multiplication operator used when the operation should be division.
- Missing semicolon.
- Question 16:
Create a class with one integer instance variable. Initialize the variable using:
- default constructor
- parameterized constructor
- Question 17: Complete the code below to create an object of Scanner class:
Scanner sc = ____ Scanner(__________); - Question 18: What is an array? Write a statement to declare an integer array of 10 elements.
- Question 19:
Name the search or sort algorithm that:
- Makes several passes through the array, selecting the next smallest item in the array each time and placing it where it belongs in the array.
- At each stage, compares the sought key value with the key value of the middle element of the array.
- Question 20:
In the program given below, state the name and the value of the:
- method argument or argument variable
- class variable
- local variable
- instance variable
class MyClass{ static int x = 7; int y = 2; public static void main(String args[]){ MyClass obj = new MyClass(); System.out.println(x); obj.sampleMethod(5); int a = 6; System.out.println(a); } void sampleMethod(int n){ System.out.println(n); System.out.println(y); } }
Related Questions
- Assignment 1: Define a class called Library with the following description:
- Assignment 2: Given below is a hypothetical table showing rates of income tax for male citizens below the age of 65 years:
- Assignment 3: Write a program to accept a string. Convert the string into upper case letters.
- Assignment 4: Design a class to overload a function polygon() as follows:
- Assignment 5: Using a switch statement, write a menu driven program to:
- Assignment 6: Write a program to accept the names of 10 cities in a single dimensional string array and their STD (Subscribers Trunk Dialling) codes in another single dimension integer array. Search for the name of a city input by the user in the list. If found, display "Search Successful" and print the name of the city along with its STD code, or else display the message "Search unsuccessful, no such city in the list".