10th Computer FLT Paper 22.09.2024
10th Computer FLT Paper 22.09.2024
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
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.