Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

SHIKSHA GREENWOODS SCHOOL – PALLIKONDA

HALF YEARLY EXAM – COMPUTER APPLICATION

SECTION - A (40 Marks)


Attempt all questions
Question 1: [10M]
a) Define expression.
b) Write the difference between unary and binary operator.
c) Evaluate: x = ++y + 2y, when y=6
d) Define ternary operator.
e) Evaluate: (To follow operator precedence)
(i) 15 - 2 * 2
(ii) 26 + 4 / 2

Question 2: [10M]

a) Write advantages by using methods in programs.


b) What is actual and formal parameter?
c) Define methods.
d) What is local variable and give an one example?
e) List out the access specifier.
Question 3: [20M]
a) Write the initial values of following data type.

(i) int (ii) float (iii) double (iv) Boolean

b) Define package.
c) List out the types of program errors.
d) Name the methods of scanner class that,
(i) is used to input an integer data from the standard input stream.
(ii) is used to input a string data from the standard input stream.

e) Write the two types of semantic errors.


f) Define arguments.
g) What is the difference between Math.ceil() and Math.floor() method.
h) Solve it:
(i) Math.ceil(1.2)
(ii) Math.floor(1.2)

(iii) Math.cbrt(64.0)

(iv) Math.sqrt(36.0)

i) Write the java expression:

(i) πr² + πr³


2
(ii) a = b + 4 ac
√ 2a

j) Name the types of error (syntax, runtime, or logical error) in each


case given below.
(i) Math.sqrt(36 - 45)
(ii) int a;b;c;
SECTION - B (60 Marks)
Any 4 questions
Question 4: [15m]
a) Write a program to calculate area of sphere with radius 7cm (Hint area = 4πr²)

b) Write a program that calculate sum of four numbers 7.9, 2.3, 8.8, and 13.5

Question 5: [15m]

Explain the folly operator with simple java program.


a) Ternary operator
b) Arithmetic operator
c) Relational operator
Question 6: [15m]
a) Write a program that implements a rectangle class. The rectangle class has
fields: length, breadth, area and perimeter. It has methods: to obtain values of
length and breadth, to calculate area and to Calculate perimeter.

b) Write a java program to print cube of a given number using a method.

Question 7: [15m]

a) Explain the scope of variable and explain with the java program.

b) Write a program that invokes a method testodd(). The method testodd if the
passed number is odd otherwise returns false.

Question 8: [15m]

a) What is programming errors and explain its types.

b) List out the common packages in java.

Question 9: [15m]

Explain 10 basic function of java.lang Math class in java with their simple java
snippet.

****All the best****

You might also like