ICSE Computer Application - Class X - 2015 PYQ
Table of Content:
Table of Content:
Define a class called ParkingLot with the following description:
Instance variables/data members:
int vno — To store the vehicle number.
int hours — To store the number of hours the vehicle is parked in the parking lot.
double bill — To store the bill amount.
Member Methods:
void input() — To input and store the vno and hours.
void calculate() — To compute the parking charge at the rate of ₹3 for the first hour or part thereof, and ₹1.50 for each additional hour or part thereof.
void display() — To display the detail.
Write a main() method to create an object of the class and call the above methods.
Write two separate programs to generate the following patterns using iteration (loop) statements:
(a)
*
* #
* # *
* # * #
* # * # *
(b)
5 4 3 2 1
5 4 3 2
5 4 3
5 4
5
Write a program to input and store roll numbers, names and marks in 3 subjects of n number of students in five single dimensional arrays and display the remark based on average marks as given below:
Design a class to overload a function Joystring( ) as follows:
Identify the literals listed below:
(i) 0.5 (ii) 'A' (iii) false (iv) "a"
Evaluate the value of n if value of p = 5, q = 19
int n = (q – p) > (p – q) ? (q – p) : (p – q);
Arrange the following primitive data types in an ascending order of their size:
(i) char (ii) byte (iii) double (iv) int
What is the value stored in variable res given below:
double res = Math.pow ("345".indexOf('5'), 3);
void paws(int a, int b) { a=a+b; b=a–b; a=a–b; System.out.println(a+ "," +b); }
char x='7'; y=Character.isLetter(x);
String a ="Smartphone", b="Graphic Art"; String h=a.substring(2, 5); String k=b.substring(8).toUpperCase(); System.out.println(h); System.out.println(k.equalsIgnoreCase(h));
(i) Name the mathematical function which is used to find sine of an angle given in radians.
(ii) Name a string function which removes the blank spaces provided in the prefix and suffix of a string.
(i) What will this code print ?
int arr[]=new int[5]; System.out.println(arr);
State the package that contains the class:
char ch ; int x=97; do { ch=(char)x; System.out.print(ch + " " ); if(x%10 == 0) break; ++x; } while(x<=100);
Write the Java expressions for:
\[ \begin{align} \\ & \frac{a^2 + b^2}{2ab} \end{align} \]