0% found this document useful (0 votes)
15 views5 pages

7535java SP 1314 - Decrypted

Uploaded by

Krishna Kanodia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views5 pages

7535java SP 1314 - Decrypted

Uploaded by

Krishna Kanodia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

http://www.icseguess.

com/

Guess Paper
Class – X
Subject – COMPUTER APPLICATIONS
(Theory)
(Two hours)
------------------------------------------------------------------------------------------------------------
Answers to this Paper must be written on the paper provided separately. You will not be
allowed to write during the first 15 minutes. This time is to be spent in reading the question
paper. The time given at the head of this Paper is the time allowed for writing the answers.
------------------------------------------------------------------------------------------------------------
This Paper is divided into two Sections.
Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [ ].
------------------------------------------------------------------------------------------------------------
SECTION A (40 Marks)
Attempt all questions
Question 1
(a) What is Java? Name some platform over which java can run. [2]
(b) What is meant by precedence of operator? [2]
(c) What is function overloading and which principal of OOP is implemented by the
function overloading? [2]
(d) What is protected access modifier? [2]
(e) Write difference between equals() and compareTo(). [2]

Question 2
(a) State difference between instance variable and local variable. [2]
(b) What is an abstract class? [2]
(c) What do you mean by runtime exceptions? [2]
(d) What is an interface? [2]
(e) Name the process [2]
i) The adjacent elements are compared while arranging elements in a specific order.
www.icseguess.com
Other Educational Portals
www.cbseguess.com | www.ignouguess.com | www.aipmtguess.com | www.aieee.com |
www.niosguess.com | www.iitguess.com
http://www.icseguess.com/

ii) The list is divided into two halves and searching takes place either in lower or upper half.

Question 3
(a) Explain the following line used in Java Program: [2]
public static void main (String args[ ])
(b) Give output of the following code snippet [2]
i) String str = new String( Java World );
System.out.println(str.substring(0). charAt(0)+str. substring(5));
ii) String str = JAVA APPLICATIONS ;
System.out.println(str.lastIndexOf(st.charAt(1)));
(c) What is dot (.) operator? [2]
(d) Name the function of Scanner class which is used to read line of text and double data
type. [2]
(e) How many times the following loop will execute and what will be final output? [2]
int i,j ;
int c=0;
for(1=1; i<=10; i*=2)
for(j=1;j<=3; j++)
c++;
System.out.print((i*j*c));
f)Convert the following for loop into equivalent while loop [2]
int i,j ;
for(1=1; i<=5; i=i+2)
for(j=1;j<=3; j++)
System.out.print((i+ ));
g) What is the return type of the following functions: [2]
compareTo(), random(),trim() and nextLong()
h) What is the use of break and continue? [2]
i) Write difference between string objects created using String and StringBuffer class. [2]
j)Name the function of Wrapper class Character which is used to check whether given
character is [2]

www.icseguess.com
Other Educational Portals
www.cbseguess.com | www.ignouguess.com | www.aipmtguess.com | www.aieee.com |
www.niosguess.com | www.iitguess.com
http://www.icseguess.com/

i) in uppercase ii) a whitespace iii) a digit iv) a character.

SECTION B (60 Marks)


Attempt any four questions from this Section. The answers in this Section should consist of
the programs in either Blue J environment or any program environment with Java as the
base. Each program should be written using Variable descriptions/ Mnemonic Codes such
that the logic of the program is clearly depicted. Flow-Charts and Algorithms are not
required.
Question 4. Define a class HireCar with following descriptions [15]
Data Members
Name- Name of the person
type – Type of A/C cab (DZIRE/ETHIOS or INNOVA)
hour- Proposed hours(4 Hr or 8 Hr) for which car is taken on rent
extrahour – Extra hour taken beyond the proposed hour of rent
rent- Total rent inclusive of driver allowance for hiring car
Member Methods-
HireCar() - Default Constructor
HireCar(…) – Parameterized constructor to accept type of ac cab, proposed hour
of rent, extra hour taken beyond the proposed hour of rent.
Calculate() - Function to calculate rent as per following tariff

Type of A/C 4Hr 8 Hr Ext/Hr


Cab
Rs. Rs. Rs.
DZIRE/ETHIOS 800/- 1600/- 125/-
INNOVA 1100/- 2100/- 160/-
Driver Allowance of Rs100/- is added to the the total rent
Display() – displays the rent by calling calculate function along with other details
of hiring a car.
www.icseguess.com
Other Educational Portals
www.cbseguess.com | www.ignouguess.com | www.aipmtguess.com | www.aieee.com |
www.niosguess.com | www.iitguess.com
http://www.icseguess.com/

Create object of this class in main method() and invoke the functions to perform the desired
task.

Question 5. Write a menu driven program to print following pattern based on user’s choice
1 or 2. [15]

Pattern 1 Pattern 2
69 68 67 66 65 A
69 68 67 66 AB
69 68 67 ABC
69 68 ABCD
69 ABCDE

Question 6. Define a class to overload a function generate() to perform following tasks [15]
generate(int n) – generates fibonacci series upto n terms– 0, 1, 1, 2, 3, 5,
…(upto n terms)
generate(int m, int n) – generates all prime numbers between m and n, assume
that m is less than n.

Question 7. Write a menu driven program to check if number entered by user is [15]
a) Supersix Number- A number which contains at least two or more sixes.
b) Automorphic number – A number is said to be automorphic if it is present as
last digit(s) in the square of itself.

Question 8. Write a program to find the smallest word in the sentence entered by user. [15]
Sample input: John enjoyed swimming in the lake
Output: in

www.icseguess.com
Other Educational Portals
www.cbseguess.com | www.ignouguess.com | www.aipmtguess.com | www.aieee.com |
www.niosguess.com | www.iitguess.com
http://www.icseguess.com/

Question 9. Write a program to store 10 integers in 1 Dimensional array. Arrange to rotate


the list so that each element is shifted to next location and last element is shifted to first
position. Print the resultant array. [15]

e-mail : [email protected]

phone: 03222- 258908

www.icseguess.com
Other Educational Portals
www.cbseguess.com | www.ignouguess.com | www.aipmtguess.com | www.aieee.com |
www.niosguess.com | www.iitguess.com

You might also like