COMPUTER APPLICATIONS
(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.
Attempt all questions from Section A and any four in Section B.
The intended marks for questions or parts of a question are given in the brackets [ ]
SECTION – A [40 Marks]
(Attempt all questions from this section.)
Question 1.
Choose the correct answer and write the correct option. [20]
i) The full form of JRE is _________
a) Java Runtime Editor c) Java Runtime Environment
b) Java Runtime Expression d) Java Runtime Enabler
ii) A program that translates an assembly language program into machine code is called __________
a) Assembler c) Linker
b) Compiler d) None of these
iii) Java uses ______ character set.
a) ASCII Only c) Unicode
b) Extended ASCII Only d) None of these
iv) Which of the following is not a token?
a) Keyword c) Operator
b) Identifier d) Procedure
v) Which of the following is a default value of float data type?
a) 0 c) 0.0f
b) 0float d) 0f
vi) For x = 5, the statement sum = ++x + 8 evaluates to ___________
a) sum = 12 c) sum = 14
b) sum = 13 d) sum = 15
vii) Assuming x = 1 with the following code snippet:
int y = --x;
Which one of the following is true?
a) x=1, y=1 c) x=1, y=0
b) x=0, y=0 d) x=0, y=1
viii) Consider the following code snippet:
float x = 8.25F;
int y;
y = (int) x;
What are the values of x and y?
a) x= 8.25, y = 8 c) x = 8.0, y = 8.0
b) x = 8, y = 8.25 d) x = 8, y = 8
_______________________________________________________________________________________________
[TPS-Std. 10- Computer Applications - Term 1 – 03/08/2023]
This paper consists of 4 printed pages.
1/4 Turn Over
ix) The scope of a local variable is limited to the ____________
a) Windows c) Class
b) Multiple programs d) Method or block it is declared in
x) Give the output of Math.ceil(-0.6).
a) -1.6 c) -1.5
b) -1.0 d) -0.0
xi) What will be the output of Math.floor(-20.10)?
a) -20.0 c) 20
b) -21.0 d) 21
xii) A programmer wrote the following statement:
netPay = grossPay + providentFund;
instead of:
netPay = grossPay - providentFund;
Assuming all the unseen code is correct, what kind of error is it?
a) Syntax error c) Logical error
b) Runtime error d) None of these
xiii) Features of java includes –
a) Robust c) object oriented
b) Secure d) All of these
xiv) Which of the following is a keyword?
a) character c) object
b) Break d) attribute
xv) Which of the following is an invalid integer?
a) 22.22 c) 22.222
b) 22222 d) 2_22
xvi) What is the extension of a source code file?
a) .java c) .class
b) .blueJ d) .obj
xvii) An object has ___________
a) Attributes c) Behavior
b) State d) All of these
xviii) The Scanner class can be used to read input from ________
a) Keyboard c) String
b) File d) All of these
xix) A method with many definitions is known as _________
a) Overflowing c) Overloaded method
b) Void method d) Multiple method
xx) Which of the following might make the Java compiler report a syntax error in a particular line of a program?
a. The program is typed in the wrong font.
b. The line contains a comma (,) instead of a dot (.).
c. It is caused by Java runtime.
d. Program takes too long to compile.
Question 2.
i) Write the java expression for the following. [2]
ax5 + by2 + c
ii) If int y = 10 then find int z = (++y * (y-- + 5)); [2]
iii) Write the output for the following:
System.out.println(“Incredible” + “\n” + “world”); [2]
_______________________________________________________________________________________________
[TPS-Std. 10- Computer Applications - Term 1 – 03/08/2023]
This paper consists of 4 printed pages.
2/4 Turn Over
iv) Give the output of following Math function: [2]
Math.max(25, Math.min(16,14))
v) Rewrite the following program segment using if-else. [2]
comm = (sale > 20000) ? sale*5/100 : 0
vi) Name any two library packages. [2]
vii) What happens when an argument is passed by reference? [2]
viii) int res = ‘A’ [2]
What is the value of res?
ix) What are errors in a program? [2]
x) Give the prototype of a function check which receives a character ch and integer n and returns true or false.
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 orany 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. Design a class to overload a function volume() as follows: [15]
i) double volume (double r) - with radius ‘r’ as an argument, returns the volume of sphere using the formula:
v = 4/3 * 22/7 * r3
ii) double volume (double h, double r) - with height ‘h’ and radius ‘r’ as the arguments, returns the volume of a cylinder
using the formula:
v = 22/7 * r2 * h
iii) double volume (double l, double b, double h) – with length ‘l’, breadth ‘b’ and height ‘h’ as the arguments, returns
the volume of a cuboid using the formula:
v=l*b*h
Question 4: Write a Java menu driven program with the following options for a circle:
1. Calculate Diameter (r*r) [15]
2. Calculate Circumference (2*pi*r)
3. Calculate Area (pi*r2)
Question 5. Create a Menu driven program to perform the following operations: [15]
1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Remainder
6. Exit
After making a selection, the program should ask the user to input two numbers and perform
the requested operation. An appropriate message should be displayed for an invalid choice.
______________________________________________________________________________________________
[TPS-Std. 10- Computer Applications - Term 1 – 03/08/2023]
This paper consists of 4 printed pages.
3/4 Turn Over
Question 7. Design a class to overload a function area() as follows: [15]
i) double area (double a, double b, double c) with three double arguments, returns the area of a scalene triangle using
the formula
area=√𝑠(𝑠 − 𝑎)(𝑠 − 𝑏)(𝑠 − 𝑐)
𝑎+𝑏+𝑐
where s= 2
ii) double area (int a, int b, int height) with three integer arguments, returns the area of a trapezium using the formula.
1
area=2 height(a+b)
iii) double area (double diagonal1, double diagonal2) with two double arguments, returns the area of a rhombus using
the formula
1
area=2 (diagonal1 * diagonal2)
Question 8. Write a program in Java that takes input using the Scanner class to calculate the Simple Interest and
the Compound Interest with the given values: [15]
i. Principle Amount = Rs.1,00,000
ii. Rate = 11.5%
iii. Time = 5 years
Display the following output:
i. Simple interest (SI = (P × R × T)/100)
ii. Compound interest ( A = P (1+ r/n)n/t )
iii. Absolute value of the difference between the simple and compound interest.
Question 9. Define a class named BookFair with the following description: [15]
Instance variables/Data members :
String Bname — stores the name of the book
double price — stores the price of the book
Member methods :
(i) void Input() — To input and store the name and the price of the book.
(ii) void calculate() — To calculate the price after discount. Discount is calculated based on the following criteria.
Price Discount
Less than or equal to Rs. 1000 2% of price
More than Rs. 1000 and less than or equal
10% of price
to Rs. 3000
More than % 3000 15% of price
(iii) void display() — To display the name and price of the book after discount. Write a main method to create an
object of the class and call the above member methods.
_______________________________________________________________________________________________
[TPS-Std. 10- Computer Applications - Term 1 – 03/08/2023]
This paper consists of 4 printed pages.
4/4 Turn Over