0% found this document useful (0 votes)
55 views6 pages

Computer Applicationscl-10 2023-24 Preboard

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

Computer Applicationscl-10 2023-24 Preboard

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

COMPUTER APPLICATIONS

MAXIMUM MARKS:100

TIME ALLOWED: TWO HOURS

CLASS-X

PREBOARD

SECTION A(40 MARKS)

Attempt all questions from this section

Question 1 [20]

Choose the correct option:

1. Identify the property shown in the given image:

Super class

Sub class Sub class

a. Inheritance b. polymorphism c. data abstraction d.


encapsulation
2. Assertion: byte code is an intermediate code which is independent of any platform(OS):
Reasoning: because it is obtained after compiling the source code and again it gets
converted to machine code.
a. Assertion and reasoning both are correct and reason is the correct explanation
b. Assertion and reasoning both are correct but reason is not the correct explanation
c. Assertion is true but reasoning is false
d. Assertion is false but reasoning is true
3. Case study: inheritance is the process of creating a new class from an existing class. The
newly created class is known as sub class and the existing class is known as the super
class. The sub class inherits all the properties of the super class.
Read the paragraph and choose the wrong option.
a. Constructors cannot be inherited.
b. Sub class also has its own properties in addition to super class properties.
c. Inheritance does not provides reusability.
d. The super class is also known as the base class.
4. Identify the correct comment line:
a. /*………**/ b. // c.//*……*/
5. It a java IDE to run java programs:
a. Bluej b.notepad c. wordpad
6. Identify the correct hierarchy of data types:
a. byte,char,short,int,double
b. byte,short, double, long
c. short, boolean, long, double
7. What will be the output of the following snippet?
class modulus
{
public static void main()
{
double a=25.64;
int b=25;
a=a%10;
b=b%10;
System.out.println(a+" "+b);
}
}
a. 5.640000000000001 5 b. 5.640000000000001 5.0 c. 5 5.640000000000001
8. Assertion: next() method in scanner class accepts value till the first blank space only.
Reasoning: because next() method does not accepts delimiters.
e. Assertion and reasoning both are correct and reason is the correct explanation
f. Assertion and reasoning both are correct but reason is not the correct explanation
g. Assertion is true but reasoning is false
h. Assertion is false but reasoning is true
9. double x=3.14;
int y=(int)Math.floor(x);
System.out.print(y);
What will the program snippet print?
a. 3.0 b. 3 c. 4.0 d. 3.5
10. The function which is used to stop the execution of program at any time:
a. System.exit(0) b. System.exit() c. exit() d. stop()
11. switch case is a multiple branching statement. It allows only int, char data type. Jump
statement break is used to avoid fall through. It is more flexible than if else if statement.
Read above paragraph and choose the wrong statement among the following:
a. switch case uses break jump statement
b. switch case is more flexible than if else if statement
c. switch case allows all data types
d. fall through is avoided by break statement
12. identify which one of the following is an infinite loop:
a. for(a=1;a<=5;a--)
b. for(a=1; ;a++)
c. for(; ;)
d. all of these
13. Read the following text, and choose the correct answer:
A class encapsulate data members that contains the information necessary to represent the class
and member methods that perform operations on the data member.

What does a class encapsulate?

a. information and operation


b. data members and member methods
c. data members and information
d. member methods and operation

14. A variable which is common for all the objects of a class.


a. static variable b. non-static variable c. instance variable d. local
variable
15. The function prototype of a function show() that returns float and takes two integer
arguments is:
a. Float show(int, int)
b. Float show(int)
c. float show(int, int)
d. all of these
16. Assertion: an argument variable can also be called a local variable.
Reasoning: because it will work only within the function in which it has been declared.
a. Assertion and reasoning both are correct and reason is the correct explanation
b. Assertion and reasoning both are correct but reason is not the correct explanation
c. Assertion is true but reasoning is false
d. Assertion is false but reasoning is true
17. Identify the constructor from the given statement:
Demo ob=new Demo();
a. Demo b. demo c. both a and b d. Demo()
18. The wrapper class of Boolean data type is:
a. Boolean b. boolean c. BOOLEAN d. all of these
19. A variable which is accessible throughout the class in which it has been declared:
a. class variable b. local variable c. global variable d. instance
variable
20. Given that int x[][]={2,4,6},{3,5,7}} find x[1][0] and x[0][2]:
a. 3 and 6 b. 3 and 7 c. 4 and 5 d. 2 and 3

Question 2 [10]

Find the output:


1. char ch[]={‘a’,’2’,’B’,’4’};
System.out.println(ch[0]+’ ‘+ch[2]);
System.out.print(ch[0]+” “+ch[2]);
2. If int m[]={1,2,3,5,7,9,13,16} what are the values of x and y?
x=Math.pow(m[4],m[2]);
y=Math.sqrt(m[5]+m[7]);
3. String n=”what are you doing?”;
String m=”I am doing my homework.”;
System.out.println(n.endsWith(“g”));
System.out.println(n.substring(0,8).concat(m.substring(9)));
4. int a,b;
for(a=6,b=4;a<=24;a=a+6)
{
if(a%b==0)
break;
}
System.out.println(a);
5. int m=2,n=15;
for(int i=1;i<5;i++);
m++; --n;
System.out.println(“m=”+m);
System.out.println(“n=”+n);

Question 3 [10]

Answer the questions given:

1. What is polymorphism? Name its types.


2. State the difference between 22 and 22L.
3. What do we mean by the term precedence of operators?
4. What is a runtime error? Explain with example.
5. What is the difference between round() and rint() methods?
6. Rewrite the given ternary operator using if else statement.
int greater=(a>b)?a:b; where a=10 and b=20
7. Convert the given snippet into equivalent for loop.
int i=0;
while(i<=20)
{
System.out.print(i+” “);
i++;
}
8. Consider the code below and answer the questions that follow:
class academic
{
void access()
{
int a,b;
academic student=new academic();
System.out.println(“object created”);
}
}
a. What is the object name of the class academic?
b. Name the class variables used in the program.
c. Write the local variables used in the program?
9. Differentiate between call by value and call by reference.
10. What is selection sorting and how it is different from bubble sorting?
SECTION B(60 MARKS)
Answer any 4questions from this section along with proper variable description

Question 1

1. Wap to enter numbers in a 3*3 matrix and check whether it is a symmetric matrix or not?
A symmetric matrix is one in which 1 st row is equal to the 1 st column, 2nd row is equal to
the 2nd column and so on.

e.g.

1 2 3

2 3 4

3 4 5

2. Wap to enter 10 number in an array and arrange them in descending order using selection
sort process?
3. WAP to print the patterns given below:
a. JAVA
JAV
JA
J
b. B
BL
BLU
BLUE
4. WAP to input the ticket amount for the customer and calculate the discount amount and
net amount to be paid according to the given table.

Ticket amount Discout

Above Rs. 70000 18%

Rs. 55001 to 70000 16%

Rs. 35001 to 55000 12%

Rs. 25001 to 35000 10%

Less than Rs. 25001 2%

Class name: ticketbooking


Member variables:
Ticamt- enter the ticket amount
Netamt- stores the net amount
Member functions:
ticketbooking(): default constructor used to initialize member variables
ticketbooking(int ta,int netamt): parametric constructor to initialize member variables
with default values
void enter(): enter the ticket amount
void computeamt(): calculate and print the discount and net amount according to the table
given above.
Write the main method to make the object of the class and call member methods.
5. WAP to overload the function series() as follows:
⮚ void series(): find the sum of the series and print
s=1+4+9+16+…….+100
⮚ void series(int n): find the sum of series and print
s=0+1+1+2+3+5+8+13+21+…..+n
6. Wap with class name: employees

Member data: int hrs,charge

Member methods:

void accept(): accept the number of extra hours worked

void calculate(): find the overtime charges according to the given criteria:

No. of hours Rate per hour

1st 3 hours Rs. 300 per hour

Next 2 hours Rs. 200 per hour

More than 5 hours Rs. 150 per hour

void display(): print the no. of hours and charge calculated.

Also write the main method to make the object of the class and call the member methods.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy