Part A (30 Marks)
1. Name any two basic principles of Object-oriented Programming
2. Write the memory capacity (storage size) of short and float data type in bytes.
3. Write a difference between unary and binary operator.
4. If the value of basic=1500, what will be the value of tax after the following statement is executed?
tax = basic > 1200 ? 200 : 100;
5. Classify the following as primitive or non-primitive data types :
(i) char
(ii) arrays
(iii) int
(iv) classes
6. [Link](“BEST”);
[Link](“OF LUCK”);
output of the above statements
7. [Link] (- 4.7)
8. [Link](3.4) + [Link](2,3)
9. [Link](“Incredible” + “\n” + “world”);
10. (i) Rewrite the following using ternary operator
if(bill > 10000)
discount = bill * 10.0/100;
else
discount = bill * 5.0/100;
11. Do as written
(a) Write a Java expression for the following
ax5 + bx3 + c
(b) What is the value of xl if x=5 ?
x1 = + +x – x++ + –x;
12. What is inheritance?
13. Name the operators listed below
(i)<
(ii) + +
(iii) &&
(iv) ? :
14. State the number of bytes occupied by char and int data types.
15. Write the output:
charch= ‘F’;
int m= ch;
m=m+5;
[Link](m+ ” ” +ch);
Part B (20 Marks)
1. Write a Programme to find Second largest number between three numbers.
2. Write a programme to store name of customer and number of units consumed and calculate the bill.