0% found this document useful (0 votes)
3 views4 pages

10 mock

This document is an examination paper for Class X Computer Applications, consisting of two sections: Section A with multiple-choice questions and Section B requiring programming tasks. Section A contains 10 questions worth 20 marks, while Section B includes programming assignments worth 30 marks, where students must write Java programs based on given specifications. The topics covered include OOP concepts, Java syntax, and problem-solving through programming.

Uploaded by

Anik Dutta
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)
3 views4 pages

10 mock

This document is an examination paper for Class X Computer Applications, consisting of two sections: Section A with multiple-choice questions and Section B requiring programming tasks. Section A contains 10 questions worth 20 marks, while Section B includes programming assignments worth 30 marks, where students must write Java programs based on given specifications. The topics covered include OOP concepts, Java syntax, and problem-solving through programming.

Uploaded by

Anik Dutta
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/ 4

CLASS X

COMPUTER APPLICATION

FULL MARKS: 50 TIME:1 hr

This Paper is divided into two Sections.


Attempt all questions from Section A and any two questions from Section B. The intended marks
for questions or parts of questions are given in brackets [ ].

SECTION A (20 marks)


(Attempt all questions from this Section.)
Question 1. [10×1 = 10]

Choose the correct answers to the questions from the given options

(Do not copy the question, write the correct option only.)

i)

Name the OOPS feature depicted by the above picture:


a) Polymorphism
b) Data abstraction
c) Inheritance
d) Encapsulation

ii) “Java compiled code (byte code) can run on any operating system” – Name the feature.
a) Robust and Secure
b) Platform independent
c) Multithreaded
d) Object Oriented

iii) Identify the type of operator : ?:


a) Ternary operator
b) Logical operator
c) Relational operator
d) Assignment operator

iv) The absence of which statement leads to fall through situation in switch case statement?
a) continue
b) break
c) System.exit(0)
d) Return

v) Assertion (A) :Non primitive data type is also referred to as Reference data type.
Reason (R) : They store data values with reference to the address or location.
a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of
Assertion (A).
b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of
Assertion (A).
c) Assertion (A) is true and Reason (R) is false.
d) Assertion (A) is false and Reason (R) is true.

vi) Forcefully converting one data type to another type is called ______________.
a) Implicit type casting
b) Automatic type casting
c) Explicit type casting

Page 1 of 4
d) Force type casting

vii) Which of the following options returns by the CompareTo( ) function if two strings are
equal?
a) True
b) False
c) 0
d) 1

viii) Assertion (A) : Function prototype is also referred as function signature.


Reaso (R) : Funcion signature is concerned with the function name and arguments
whereas the function prototype takes care of the full functional interface including the
signature, return type, and access specifier.

a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of
Assertion (A).
b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of
Assertion (A).
c) Assertion (A) is true and Reason (R) is false.
d) Assertion (A) is false and Reason (R) is true.

ix) Nilesh wants to print the following message:


India is the winner of “ICC T20 World Cup 2024”. He is getting an error to execute the
following code: System.out.println(“India is the winner of “ICC T20 World Cup 2024” ”);
Which of the following options will help him to debug the above code?

a) System.out.println(India is the winner of “ICC T20 World Cup 2024”);


b) System.out.println(“India is the winner of \“ ICC T20 World Cup 2024\” ”);
c) System.out.println(“India is the winner of ICC T20 World Cup 2024”);
d) None of the above

x) The String class method to join two strings is:


a) .concat(String)
b) <string>.joint(string)
c) concat(char)
d) Concat( )

Question 2.

i) Rewrite the following code with the Ternary operator: [2]


if(marks>=90)
char Grade= ‘A’;
else
char Grade= ‘B’;

ii) Evaluate the given expression when the value of k=8, m=11 and r=7 [2]
k+= (--m%5)*(m++ *(10 + r++))

𝑥𝑦
iii) Write the Java expression for 𝑥 3 + 𝑦3 − [2]
𝑧

iv) Give the output of the following program segment (show the rough work): [2]

int n=4279;
int d,s;
s=0;
while(n>0)
{
d=n%10;
s=s+d;
n=n/100;
}
System.out.println(“The sum is=”+s);

(v) Give the output of the following code: [2]

String s= “COMMITTEE”;
Page 2 of 4
System.out.println(s.substring(3,(s.lastIndexOf(‘T’))));

Section -B [30 Marks]


(Attempt any two 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 so that the logic of the
program is clearly depicted.
Flow charts and Algorithms are not required.

Question 3. [15]
Write a program to define a class HotelBill as follows:

Data members:
cust_name, check_in_date, check_out_date, no_of_days, bill.

Member methods:
HotelBill( ): default constructor to initialize all the member variables.

void take_input( ): to input all member variables.

void compute( ): to calculate the bill amount as below:

No. of Days Rate/Day


First 5 days ₹ 250
Next 10 days ₹ 500
Above 15 days ₹ 300

void display( ): to display customer name, no of days, and bill amount. Write a main method to
create an object of the class and call the member methods.

Question 4. [15]
Design a class to overload a function Sum( ) as follows:

int Sum(int A, int B) – with two integer arguments (A and B) calculate and return the sum of all the
even numbers in the range of A and B.

Sample input: A=4 and B=16


Sample output: sum = 4 + 6 + 8 + 10 + 12 + 14 + 16

double Sum(double N ) – with one double arguments(N) calculate and return the product of the
following series:
sum = 1.0 x 1.2 x 1.4 x …………. x N

int Sum(int N) – with one integer argument (N) calculate and return the sum of only odd digits of the
number N.

Sample input: N=43961


Sample output: sum = 3 + 9 + 1 = 13

Question 5. [15]

Using the switch statement, write a menu driven program to perform the following operations:
To Print the value of Z where Z = (𝑥³ + 0.5𝑥) / 𝑌 where x ranges from – 10 to 10 with an increment of
2 and Y remains constant at 5.5.

To print the Floyds triangle with N rows


Example: If N = 5, Output:
1
23
456
7 8 9 10
11 12 13 14 15

Question 6. [15]
Write a program in Java to check whether a given number is a duck number or not.

Page 3 of 4
[Note: A number is said to be a duck number if it contains zero, but the number 0 should not be in
the initial position of the number.
For example: 4509, 3024, 6780, etc. are examples of duck numbers.
Whereas the numbers such as 0123, and 09780 are not duck numbers.

Page 4 of 4

You might also like