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

10th Computer FLT Paper 22.09.2024

Uploaded by

aritrapal715
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)
50 views6 pages

10th Computer FLT Paper 22.09.2024

Uploaded by

aritrapal715
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/ 6

STD : 10TH DATE : 21.09.

2024
SUB : COMPUTER MARKS : 100
Question 1 [20]
Q.1 CHOOSE THE CORRECT ANSWERS
1) The method of Scanner class to accept a 64-bit floating point number is:
(a) nextInt() (b) nextLong() (c) nextFloat() (d) nextDouble()
2) Classes, interfaces, methods, packages and variables are together called:
(a) Keywords (b) Identifiers (c) User defined words (d) None of the these
3) Predict the output: System.out.println (‘B’ +2);
(a) 100 (b) B2 (c) 1002 (d) 68
4) The feature of OOP implemented by Method overloading is:
(a) Inheritance (b) Polymorphism (c) Encapsulation (d) Data abstraction
5) Name the package that contains ‘String’ class.
(a) java.lang (b) java.io (c) java.awt (d) java.applet
6) Semicolon (;) in Java programming is a kind of:
(a) Operator (b) Separator (c) Special Symbol (d) Literal
7) The value of variable r in the following statement will :double r = Math.rint (28.5);
(a) 28 (b) 28.0 (c) 29 (d) 29.0
8) What is the return type of indexOf() function of string class?
(a) char (b) String (c) boolean (d) int
9) Name the method used to convert String value into int?
(a) ParseInt() (b) parseInt() (c) parseInteger (d) none of these
10) The ……… allows a class to use property of another class.
(a) Encapsulation (b) Abstraction (c) inheritance (d) None of these
11) The ……… operator is used to access method of a class.
(a) Object (b) new (c) (.)dot (d) import
12) The statement System.out.println(1+2+“four ”+2+3); gives the output………
(a) 3 four 5 (b)3 four 23 (c) 12 four 23 (d) error
13) x + = x++ + --x + --x + x; [ x = 5 ]
(a) 23 (b) 20 (c) 18 (d) none of these
14) Math.pow(Math.ceil(4.22), Math.cbrt(8));
(a) 16 (b) 25 (c) 25.0 (d)16.0

HARD WORK UNDER PROPER GUIDANCE IS KEY TO SUCCESS


15) The return data type of Integer.parseInt( ) method is ________ .
(a) String (b) int (c) void (d) Integer
16) Corresponding wrapper class of the char data type is?
(a) String (b) Character (c) Char (d) CHARACTER
17) a ____________ method needs to be called with the help of object
(a) void (b) class (c) static (d) nonstatic
18) What will be the result produced by the following statement ?
Math.ceil(8.4) + Math.pow(2,2);
(a) -13 (b) -9.45 (c) -7.75 (d) 13.0
19) Name the package that contains ‘Integer’ class.
(a) java.lang (b) java.awt (c) java.io (d) java.applet
20) (xiv) Predict the output:
System.out.println("MONARCH".substring(4).charAt(0));
(a) A (b) R (c) C (d) M
Question 2(write all questions) [10×2=20 M]
1. Write Java Expression
√(3𝑎)+ 𝑏2+2 𝑎 b
2. Java Evaluation
If x = 20, determine the value of:
x += x * x - ((--x) * (x--))
3. Find the output
a) double x = Math. floor(Math.min(0,-1.5));
b) double x = Math.min(Math. floor (-5.9),Math.ceil(-5.9));
4. Write difference between actual parameter and formal parameter?
5. Write difference between call by value and call by reference?
6. _rewrite the following code using do while loop
int amount = 100 ;
while(amount>0)
{
System.out.println(amount);
amount=amount-1;
}
7. What is the final value of count when the iteration process given below executes?
int count =0;
for(int i=1;i<=10;i++)
for(int j=1;j<=10;j+=2)
++count;
HARD WORK UNDER PROPER GUIDANCE IS KEY TO SUCCESS
8. Analyze the given program segment and answer the following questions:
for(int m = 5; m <= 20; m+=5)
{
if(m % 3 == 0)
break;
else if(m % 5 == 0)
System.out.println(m);
continue;
}
(i)Write the output of the program segment.
(ii) How many times does the body of the loop gets executed?
9. if StringX = "Computer"
String Y = "Applications"
What do the following functions return?
(a) System.out.println(X.substring(1,5));
(b) System.out.println(X.indexof(X.charAt(4));
(c) System.out.println(Y + X.substring(5);
(d) System.out.println(X.equals(Y));
10. Give the output of the following:
(a) System.out.println("Hello" +2+5);
(b) System.out.printin("Hello"+ (2+5);
(c) System.out.println("'B".compareTo(A"));
(d) System.out.println("Welcome".charAt(2) + "Welcome".charAt(o));

HARD WORK UNDER PROPER GUIDANCE IS KEY TO SUCCESS


SECTION B [4 × 15= 60]
(Answer any four questions out of six questions each program carries 15 marks.)
The answers in this section should consist of the programs in either BlueJ environment or any program
environment with java as the base.Each program should be written using variable description / mnemonic
codes so that the logic of theprogram is clearly depicted.Flowcharts and algorithms are not required

1. Write a program that encodes a word into Piglatin. To translate word into Piglatin word, convert the
word into uppercase and then place the first vowel of the original word as the start of the new word
along with the remaining alphabets. The alphabets present before the vowel being shifted towards the
end followed by "AY".
Sample Input 1: London
Output: ONDONLAY
Sample Input 2: Olympics
Output: OLYMPICSAY
2. Write a program to input a number and check whether the number is a PalPrime Number or not :
A PalPrime Number is a number where the number is palindrome as well as prime
Example : 7, 131, 313, etc
11, 19
13, 17
3. Design a class to calculate the tax for the people living in USA. Specify a class
taxpayer whose class description is given below
Class name : taxpayer
Data members :
int pan - to store the personal account number
String name – to store the name of a person
float taxable – to store the total annual taxable income
float tax – to store the tax that is calculated
Member Methods :
inputdata () – to enter the data for a taxpayer
displaydata () – to display the data for a taxpayer
computetax() – to compute tax for a taxpayer
The tax is calculated according to the following rules
Total annaual taxable income Rate of taxation
Upto 60000 0%
Above 60000 but upto 150000 5%
Above 150000 but upto 500000 10%
Above 500000 15%
HARD WORK UNDER PROPER GUIDANCE IS KEY TO SUCCESS
Create an object of the type taxpayer calculate the tax for the taxpayer and output it in the
following format:
Pan No Name Taxable income tax
4. A private Cab service company provides service within the city at the following rates:
AC CAR NON AC CAR
Upto 5 KM ₹150/- ₹120/-
Beyond 5 KM ₹10/- PER KM ₹08/- PER KM
Design a class CabService with the following description:
Member variables /data members:
String car_type — To store the type of car (AC or NON AC)double km — To store the kilometer
travelled
double bill — To calculate and store the bill amountMember methods:
CabService() — Default constructor to initialize data members. String data membersto '' '' and
double data members to 0.0.
void accept() — To accept car_type and km (using Scanner class only).
void calculate() — To calculate the bill as per the rules given above.
void display() — To display the bill as per the following format:
CAR TYPE:
KILOMETER TRAVELLED:
TOTAL BILL:
Create an object of the class in the main method and invoke the member methods.

5. Define a class to overload the method display() as follows:


 void display(): To print the following format using nested loop.
12121
12121
12121
 void display(int n, int m): To print the quotient of the division of m and n if m is greater than n
otherwise print the sum of twice n and thrice m.
 double display(double a, double b, double c): to print the value of z where z = p*q
p = (a + b) / c
q=a+b+c

HARD WORK UNDER PROPER GUIDANCE IS KEY TO SUCCESS


6. Define a class to overload the function print as follows:
 void print() - to print the following format
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
5 5 5 5
 void print(int n) - To check whether the number is a lead number. A lead number is the one whose
sum of even digits are equal to sum of odd digits.
e.g. 3669
odd digits sum = 3 + 9 = 12
even digits sum = 6 + 6 = 12
3669 is a lead number.

HARD WORK UNDER PROPER GUIDANCE IS KEY TO SUCCESS

You might also like