Computer Application Subjective Paper 1
Subjective Paper 1
FOR ICSE X SEMISTER II EXAM
Computer Application
MARKS: 100 TIME: 2 hours
SECTIONA (40 Marks)
Attempt all the questions from this section.
Question 1
a) What is a wrapper class Name the wrapper classes used in java. 2 Marks
b) Explain autoboxing and unboxing in java. 2 Marks
c) what is Inheritance? Which keyword is used to implement inheritance?
2 Marks
d) How do you initialise single ana 2-aimensional arrays? Explain with examples. 2 Marks
e) Give the output of the following program fragment:
String s=new String("He went to the market");
String r;
r=s.replace("went", "is going");
System.out.println(r);
Question 2
a) State the advantages and disadvantages of using arrays. 2 Marks
b) What can't a class be declared as private? 2 Marks
c) What is encapsulation? 2 Marks
d) Give the difference between linear search and binary search. 2 Marks
e) What will be the output of the following code? 2 Marks
float x = 7.87;
System.out.println(Math.ceil(x);
System.out.println(Math.floor(x);
Question 3
a) Why is a class known as a composite data type? 2 Marks
b) How are packages created in BlueJ? 2 Marks
c)What will be the output of the following program segments? 10 Marks
i) String s = new String("abc");
System.out.println(s.toUpperCase());
ii) String str1 = "great"; String str2 = "minds";
System.out.println(strl.substring(0,2).concat(str2.substring(1)));
iii) class First
{
public static void main(String args[])
{
int a[]={5,1,15,20,25];
int i,j;
int m;
i=++a[1];
j=a[2]++;
m=a[i++];
System.out.print(i+" "+j+" "+m);
}
}
iv) class Output
{
public static void main(String args[])
int a,b=0;
int c[]={1,2,3,4,5,6,7,8,9,10);
for(a=0;a<10;a++)
{
if(a%2= = 0)
b+=c[a];
}
System.out.print(b);
}
}
v) String A="26", B="100";
String D=A+B+"200";
int x=Integer.parseInt(A);
int y=Integer.parseInt(B);
int d=x+y
System.out.println("Result 1="+D);
System.out.println("Result 2="+d);
d) Differentiate between isUpperCase(char) and toUpperCase(char).
2 Marks
e) What is the difference between String and Array? 2 Marks
f) Write one-word answer for the following: 2 Marks
i) A method that converts a string to a primitive integer data type
ii) The default initial value of a boolean variable data type
SECTION B (60 Marks)
Attempt any four questions from this section.
Question 4
Define a class taximeter having the following description:
Data members/instance variables: 15 Marks
int taxino - to store taxi number
String name - to store passenger's name
int km - to store number of kilometres travelled
Member functions:
taximeter()-constructor to initialize taxino to 0, name to " "and b to 0.
input()- to store taxino,name,km
calculate() – to calculate bill for a customer according to given con
kilometers travelled(km) Rate/km
1 km Rs 25
1< km 6 Rs 10
6< km 12 Rs 15
12< km 18 Rs 20
>18 km Rs 25
display()- To display the details in the following format
Taxino Name Kilometres travelled Bill amount
Create an object in the main method and call all the above methods in it.
Question 5 15 Marks
Create a function int sum (integer a) which accepts an Integer object as parameter and returns the sum of its digits. In the main () input an integer and find the sum of its digits using the above method.
Question 6 15 Marks
write a program to accept a sentence and print only the first letter of each word of the sentence in capital letters separated by a full stop.
Example:
INPUT SENTENCE: "Welcome To School"
OUTPUT: W.T.S.
Question 7 15 Marks
Write a program to create an array to store 10 integers and print the largest integer and the smallest integer in that array.
Question 8 15 Marks
Write a program to input the area of a square and find its perimeter.
Question 9 15 Marks
Write a program to store 10 names in an array. Arrange these in alphabetical order by sorting. Print the sorted list. Take single word names, all in capital letters, e.g. SAMSON, AJAY, LUCY, etc.
Comments
Post a Comment