0% found this document useful (0 votes)
28 views5 pages

COMPUTER X 1st Term

This document outlines the first assessment for Class 10 Computer Applications at Don Bosco School, Liluah for the academic year 2024-25. It includes instructions for answering questions, a breakdown of the assessment into two sections, and a variety of questions covering Java programming concepts, including multiple-choice questions, coding tasks, and theoretical questions. The document also specifies the format and expected outputs for programming assignments.

Uploaded by

srinjonsen2009
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)
28 views5 pages

COMPUTER X 1st Term

This document outlines the first assessment for Class 10 Computer Applications at Don Bosco School, Liluah for the academic year 2024-25. It includes instructions for answering questions, a breakdown of the assessment into two sections, and a variety of questions covering Java programming concepts, including multiple-choice questions, coding tasks, and theoretical questions. The document also specifies the format and expected outputs for programming assignments.

Uploaded by

srinjonsen2009
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/ 5

flaviou

DON BOSCO SCH0OL, LILUAH FIRST ASSESSMENT 2024-25


TIME-2HRS
CLASS-10
F.M-100 COMPUTER APPLICATIONS
Answers to this Paper must be writen on the paper provided separately.
You will not be allowed to write during thefirst 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 answe.
This Paper is divided into two Sections.
Attempt all questions from Section Aand any four questions from Section b.
The intended marksfor questions or parts ofquestions are given in bracketsJ
Section A
(Answer all questions from this Section) [1x20=20|
Question 1
Choose thecorrect answers to the questions from the given options.
(Do not copy the question, write the correct answers only.)
() Name the feature of programming depicted in the picture given below.

a)Polymorphism b)Encapsulation c)lnheritance d)Abstraction


(ü) Predict the output of the following statement:
System.out.print(Math.floor(-2.74)-Math.ceil(78.999) +"Namah".lastindex Of('h');
a)-78.0 b)Error c)-77.0 d)-81.0
(ii) Who invented Java Programming?
a)Guido van Rossum b)James Gosling c)Dennis Ritchie d)Bjarne Stroustrup
(iv) Ifx=890, y=-10, determine the value of xafter executing(as int):
X+ =++x%5+ x++ - y*2 + -(x%y);
a) 1804 b)Error c)1800 d)910
(v) Assertion(A):String variable is a named memory location that contains a string constant or a string
literal.
Reason(R): The numeric constants stored on String variables can be used for any arithmetical
operations.
(a) Both Assertion(A) and Reason(R) are true Reason(R) is a correct explanation of Assertion(A)
(b) Both Assertion(A) and Reason(R) are true 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) Predict the output: (Math.rint(77.5)-Math.rint(78.5) +Math.sqrt(Math.pow(36,(3/2);
a)-10.0 b)5.0 c)6.0 d)-10
(vii) Predict the output when ASCIl code of '2' is 50:
char P=2';
String Q="24";
System.out.printin (P+(int)P+Q);
a)124 b)10024 c)25024 d)P74
(viii) Which of these are selection statements in Java?
a)break b)continue c)for) d)if)
(iN) In Java, can a method have same name as the class?
(a) Yes, it is a constructor
(b) Yes, it is a statie method
(o) Yes, it is a publie method
() No, itis notallowed
() What is the value of tip aler executing the following code snippet?
int meal $;
int tip 2;
int total meal +(meal>6 ? ip t-tip);
a)l b)2 c)3 d6
(x) Predict the output:
publie class science
public static void main(String [Jargs)(
String strl= "Matter";
String str2 -"Matter",
String str3new String("Matter"):
System.out.println(strl.equals(str2) && (str mstr3):

a)True b)False c)false d)true


(xi) Which two primitives have wrapper classes that are not merely the name of the primitive with an
uppercase letter?
a)byte and char b)byte and int c)char and int d)boolean and double
(xii) Assertion(A): The logical operators are used between two or more conditions in a Java statement.
Reason(R): When applied in a Java program, they result in right or wrong, depending upon the
values in all the condition.
Based on the above discussion, choose an appropriate statement from the options given below.
(a) Both Assertion(A) and Reason(R) are true Reason(R) is a correct explanation of Assertion(A)
(b) Both Assertion(A) and Reason(R) are true 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
(xiv) Predict the output:
String str = "Iam the Best":
System.out.printin(str.replace("t", "A").lastIndexOf("):
a)12 b)Error c)0 d)-1
(xv) Which of the following declarations does not compile?
(a) double numl, int num2 = 0;
(b) int num 1, num2;
(c) int num1, num2 =0;
(d) int numl =0, num2 =0;
(xvi) Give the output of Math.sqrt(-3.6).
(a) NaN
(b) Nan
(c) 1.8973665961 010275
(d) - 1.897366596 1010275
(xvii) Which of the following is not true with regards to a switch statement?
(a) Checks for an equality between the input and the case level
(b) Supports floating point constant
(c) break is used to exit from the switch
(d) case labels are unique
(xviii) Which of the following for loop declaration is not valid?
(a) for (int i 99; i > 0; i/9)
(b) for (int i= 7; i< 77; i += 7)
(c) for (inti 20; i> 2; --)
(d) for (int i2;i c 20; i2* i)
(xiX) The number of byte/bytes occupied by the constant 45 is/are:
a)4 b)2 c)8 d)l
(XX) Predict the output of the following code snippet:
publicclass Main
public static void main(String[] args) (
String s= "Banking";
S.concat(" System");
System.out.println(s);
a)Error b)Banking c)Banking System d)BankingSystem
Question 2 (2x10=20j
(i) Write the java expression for: Ix+yà-2+x'I.
(ii) Write the snippet to print a random integer between 100 and 567.
(iii) Evaluate the java expression and predict the value of x:
int x=1,y=2,z=3;
X-=-ytt+ z*x- -y%10+ -8/3;
(iv) Rewrite the following program segment using logical operators:
if(x>5)
{if(>y)
System.out.printIn(x+ty);}
(V) Name any two components essentially needed to definea class.
(vi) Predict the output, when executed:
int a=5;
while(--a>5)
{System.out.print(a);
(vii) Which datatype is returned by the following library methods?
(a) isWhitespace():
(b) compareTolgnoreCase():
(vii)) State whether the following statement is true or false: "Inheritance supports the concept of
reusability". Give reason to support your answer.
(ix) Write the memory capacity(storage size) of short and float data types in nibbles.
(x) Write the snippet to find out whether agiven number is divisible by 5or not, if not then print the
nearest number from the given number which is divisible by 5.
SECTIONB
(Answer any four questions from this Section.)
The answes in this section should consists of the programs in either Bluel environment or any
program environment with java as the base.
Each program should be written using variable description/ mnemoniccodes so that the looie at
the program isclearly depicted.
Flowcharts and algorithms are not required.

Question 3: |15|
Design aclass RailwayTicket with following description:
Instance variables/data members:
String nameTo store the name of thecustomer.
String coach To store the type of coach customer wants to travel.
long mobno -To store customer's mobile number.
int amtTo store basic amount of ticket.
int totalamt - To store the amount to be paid after updating the original amount.
Member methods:
void accept() -To take input for name, coach, mobile number and amount.
void update() - To update the amount as per the coach
selected (extra amount to be added in the amount as
follows)
Type of Coaches Amount
First AC 700
Second AC 500
Third AC 250
sleeper None
void display() -To display all details of acustomer such as
name,
Write a main method to create an object of the class and call the coach, total amount and mobile number.
above member methods.
Question 4:
The International Standard Book Number (ISBN) [15]
is a unique numeric book identifier which is
every book. The ISBN is based upon a 10-digit code. printed on
The ISBN is legal if:
1xdigitl +2 xdigit2 +3 x digit3 + 4 x digit4 +5 x digits + 6 x digit6 + 7 x
+ 10x digit10 is divisible by 11. digit7 +8 x digit8 +9x digit9
Example:
For an ISBN 1401601499
Sum = 1x1+2 x 4 +3x 0+4 x 1+ 5 x6+ 6x 0+7 x |+8 x 4+9 x9 +10 x9 =253 which is
divisible
by 11.
Write a program to:
1 Input the ISBN code as a 10-digit integer.
2 If the ISBN is not a 10-digit integer, output the message "Illegal ISBN" and terminate the program.
3 If the number is divisible by 11, output the message "Legal ISBN". Ifthe sum is not divisible by l1,
output the message "Illegal ISBN".
Question5: |15]
Write a menu driven program to perform the following operations as per the user's choice:
1. To print the value of ca'+2ab, where a varies from 1.0 to 2,0 and b=3.0is a
with increment of
20.0
constant.
2. To display the following pattem using for loop
A
AB
ABC
ABCD
ABCDE
Display proper message for an invalid choice.
|15]
Question 6:
and special characters). Perform
(including digits
Write a program in Java to accept astring in a mixed case
the following tasks as per the user's choice:
1. Count and display the number of vowels.
2. Count and display the digit.
characters, excluding white spaces.
3. Count and display the number of special
Sample input: 15 August is celebrated as "Independence Day"
Sample output:
Number of vowels = 15
Number of digits =2
Number of special characters -2.
[15]
Question 7:
display() as follows:
Define a class to overload the method
using nested loop
void display(): Toprint the following format
12121
12121
user)
12121 (input the number of row from division of and n ifm isgreater thann,
m
otherwise
the quotient of the
void display(int n,int m):To print
n and thrice m
print the sum of twice
b,double c): to print the value of z, where z=p*q
double display(double a,double
p-(atb)/c and q=a+btc
[15]
number is
Question 8:
and check whether the number is an Adam number or not. A
Write a program to input a number square of a number is equal to the
square of the reverse if the
Number if the reverse of the
called an Adam
number. value.]
number then just print its absolute
[If the user enters a negative
Example: 12
reverse is 441
Square of 12=144 and its
2|=441
Reverse of 12-21 and square of
Thus, 12 is an adam number.

You might also like