Class - X Computer Q.P

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

|| Jai Sri Gurudev ||

BGS WORLD SCHOOL


Gnana Ganga Campus, Chickballapur
Half Yearly Exam Oct / Nov – 2020

Class X Sec: Sub: Computer Application Marks: 100


Name: Time: Two Hours Roll No:

This paper is divided into to two Sections:

Attempt all the questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [ ].

Section – A (40 Marks)

[Answer all the questions]

Question -1

a. Define the terms with an example: [2]


i. Data Abstraction ii. Polymorphism
b. Why Class is known as Composite Data Type? [2]
c. What is meant by type conversion? How is an Implicit type Conversion different from an [2]
Explicit type conversion.
d. Write a difference between Unary and Binary operators. [2]
e. Identify and name the following Tokens. [2]
i. public ii. ‘a’ iii. = = iv. { }

Question – 2

a. What is meant by package? Name any two packages available in Java. [2]
b. Write any two differences between Call by value and Call by Reference. [2]
c. Write the Java Expression for Z = 5𝑥 2 + 2𝑦/(𝑥 + 𝑦) [2]
d. Give the output of the following Math Functions: [2]
a. Math.ceil(5.2)
b. Math.abs(-5)
e. if int x[ ] = {4, 3, 7, 8, 9, 10};
What are the values of P and Q? [2]
i. P = x.length
ii. Q = x[2] + x[5] * x[1]
Question – 3

a. Write any two differences between an Object and a Class. [2]


b. Give a function prototype of a function that returns a double value an takes a [2]
three double parameters x, y, and z as its parameters.
c. What is a Constructor? When it is invoked. [2]
d. What is the Data Type that the following Library Functions returns. [2]
i) isWhitespace(char ch)
ii) Math.random( )
e. Evaluate the following expression if the value of x = 2, y = 3, and z = 1 [2]
V = x + ++x + --z + ++y + y++ + y

Question – 4

a. What is an Array? Write a statement to declare an integer Array of 10 Elements. [2]


b. Write the output of the following code snippet [2]
String s1 = “java”;
String s2 = “island”;
System.out.println(s1.substring(0).concat(s2.substring(2)));
System.out.println(s2.toUpperCase());
c. Write the Output of the following Program code: [2]
Char ch;
int x = 97;
while(x <= 100)
{
ch = (char) x;
System.out.println(ch + “ “);
If(x % 10 = = 0)
break;
++x;
}
d. Rewrite the following program segment using the if – else - if statements instead of the [2]
ternary operator.
String grade = (mark >=90)? “A” : (mark >= 80)? “B” : “C”;
e. Write the difference between equals( ) and compareTo( ) methods. [2]
Section – B (60 Marks)

Attempt any four questions from this Section.

The answers in this Section should consist of Programs in either Blue J 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 the program
is clearly depicted.

Flow – charts and Algorithms are not required

Question – 5 [15]

Design a class named ShowRoom with the following description:

Instance Variables/data members:

 String name: to store the name of the Customer.


 long mobno: to store the mobile number of the Customer.
 double cost: to store the cost of the items purchased.
 double discount: to store the discount amount.
 double amount: to store the amount to be paid after discount.

Member Methods:

 Showroom( ): default Constructor to initialize data members.


 void input( ): to input Customer name, mobile, number, cost from the user.
 void calculate( ): to calculate discount on the cost of purchased items, based on the following

criteria:

Cost Discount(Percentage)
Less than or equal to Rs. 10000 5%
More than Rs. 10000 and less than or equal to Rs.20000 10%

More than Rs.20000 and less than or equal to Rs.35000 15%

More than Rs. 35000 20%

 void display( ): to display Customer name, mobile number, amount to be paid after discount.
 Write a main( ) method create an object of the class ShowRoom and call the above member methods.
Question – 6

Using Switch – case statement, write a menu – driven program to do the following: [15]

a) To find the sum of the series:

1/ 1! + 2/ 2! + 3/ 3! +………1/ n!

b) Write a Java program to display the following Pattern:

B
BL
BLU
BLUE
BLUEJ

Question – 7

Write a Java program to accept a number and check and display whether it is a Happy Number or not. [15]

Question – 8

Write a Java program to input 15 Integer elements in an Array and sort them in ascending order [15]

using the Bubble Sort technique.

Question – 9

Write a Program(Using Scanner Class) to enter a String / Word in mixed case and display the [15]

new word after deleting all the vowels.

Input: Computer

Output:

C
m
p
t
r

**********

You might also like