10 Computer Application Mock Test
10 Computer Application Mock Test
10 Computer Application Mock Test
M 100
V I D Y A P E E T H TIME 2 Hrs.
SECTION – A
(Attempt all questions from this Section)
ii. The memory capacity (storage size) of short and float data type in bytes.
a. 2 and 4 b. 1 and 4 c. 1 and 2 d. 2 and 8
iii. What will be the value of a after execution of following expression: int a=8, b=2, c=1;
a%=b+c++ +b+c;
a. 9 b. 1 c. 8 d.5
iv. Identify OOPS concept is being featured in following real life example:
When a subordinate showed a diligent performance, the boss shared some of his authorities
with him.
a. Encapsulation b. Polymorphism c.inheritance d. Abstraction
v. Name a keyword to allocate a memory to an object.
a. dot b. new c. this d. allocate
vii. Name the primitive data type in Java that is: A 64-bit integer and is used when you
need a range of values wider than those provided by int.
a. int b. double c. long d. float
xiv. Once a function is defined it can be invoked repeatedly. Name this feature of java.
a. Interface b. reusabi1ity c. robust d. Platform independent
xix. which method of scanner class is used to accept a word from the String entered:
a. nextline() b. next() c. nextLine() d. wordextract()
xx. Find the output of the following code
int m= 49;
switch(m+ 1)
{
default: System .out.println( Math . pow ( 5.2));
case 49: System.ont .println(Math.sqrt(m));
break;
}
a. 25.0 b. 25.0 c. expression m+1 cannot he written. d. default should be always at the end.
7.0
Question 2:
i. Find the output for the following: [2]
a. System.out.println("WELCOME"+20+20);
b. System.out.println(`e'+20+"20");
ii. Name the type of conversion in statement 1 and statement 2: [2]
char ch=’C’;
System.out.println((ch+1)); // statement 1
System.out.println((char)(ch+1)) ;// statement 2
iii. Name the following: [2]
a. The keyword which converts variable into constant.
b. The method which terminates the entire program from any stage.
iv. Rewrite the following program segment using logical operators: [2]
if ( x > 5 )
if ( x > y ))
System.out.println (x+y);
v. What will be the output when the following code segment is executed? [2]
char ch=’C’;
System.out.println((ch+ 1 )-+ " "+ ++ch);
vi. Write the difference between Math.ceil() and Math.floor(). [2]
vii. Convert the following for loop into do while loop: [2]
for (i = 10 ; ; i = i – 3)
{
if (i==4)
break;
System. out. print(i);
}
viii. Give the output of following code and mention how many times the loop will execute? [2]
int i=5;
while (i-- >=1)
{
if (i%2 ==1)
continue;
System.out.print(i+" ");
}
ix. Identify and name the following tokens: [2]
a. public b) 'a' c) = = d) { }
x. Answer the following as instructed: [2]
2
a. Write a Java expression for the following: |x + 2xy |
b. What will be the output:
System.out.println("\"I\" am the \n\Topper\””);
Question 3: [15]
Each Program should be written using variable description / mnemonic codes.
Define a class employee having the following description:
Data members/instance variables:
int pan — to store personal account number
String name — to store name
double tax income — to store annual taxable income
double tax — to store tax that is calculated
Member functions:
input() — Store the pan number, name, taxable income
calc() — Calculate tax for an employee
display() — Output details of an employee
Write a program to compute the tax according to the given conditions and display the output as
per given format.
output:
Question 4: [15]
Write a menu driven java program to perform the following task according to user’s choice.
Accept the values
as and when required:
a. Print the following series: 0,7,26, 63..... N terms.
b. Print the sum of the following series: 1/1-2/4+3/9-4/16....n terms
c. Print the sum of the following series: x2 + x4 + x6 + x8 …. n terms.
Question 5: [15]
Write a java program to check whether the entered number is a tech number or not.
A tech number has even number of digits. If the number is split in two equal halves, then the
square of sum of these halves is equal to the number itself. Write a program to generate and print
all four digits tech numbers.
Example:
Consider the number 3025
Square of sum of the halves of 3025 = (30 + 25)2
= (55)2
= 3025 is a tech number.
Question 6: [15]
Write a program to computerize the billing operation of a telephone of a telephone company. The
bill has to be generated based on the following conditions:
Number of calls Amount per call
First 50 calls free
Next 100 calls 50 Paisa per call
Next 200 calls 80 Paisa per call
Rest of the calls Rs 1.20 per call
A rent of Rs 120 is charged from every customer. A tax of 15% is charged on the sum of charges
and rent. The total amount is tax added to the sum of charges and rent .Print the bill for a
customer.
Question 7: [15]
(i) Write a program in java to print the Mersenne Numbers (i.e., the numbers in the form 2n − 1).
Read a limit from user and print all numbers until it exceeds the given limit. Also mention
which(nth) number has exceeded the limit.
(ii) Write a Java Program that reads a string and tests whether it begins with an uppercase letter
or not
Question 8: [15]
Write a menu driven java program to perform the following task according to user’s choice.
1. Check whether a number is a palindrome number
A palindrome number is a number that is the same after the reverse.
2. Print Tribonacci series:
0, 1, 1, 2, 4, 7, 13…n terms.
-----------------------