You are on page 1of 1

Test 5 Fm:-30

Q.1.Answer the following questions:-(2x5=10m)


a) Define the terms class and object.
b)How is an object represented in software terms?
c)Why is an object called an instance of a class?
d)Why is class called an object factory?
e) How do objects encapsulate state and behaviour.
Q.2.Do as directed:- (2x5=10m)
a) Write java expressions:-
−b+ √ b2 −4 ac
i)
2a
ii)√ c 2 + a2+ b2
b)Write dry run and output:-
int a=50,b=5,c=4;
System.out.println((a*b)/c);
System.out.println((a+b)+” “+c);
System.out. println(c/b+” “+c%a);
c) int i=3;
i++;
System.out.println(i);
++i;
System.out.println(i);
System.out.println(++i);
System.out.println(i++);
System.out.println(i);
d) int a=11;
a+=a++ + ++a + --a +a --;
System.out.print(a);
e)int y=9; y+=++y+y--+--y;
System.out.println(y);
Q.3.Write a program to accept pan number, name, taxable income And compute the tax
<=100000 0%
100001-150000 10% of the income exceeding 100000
150001-250000 5000+20% of the income exceeding 150000
>250000 25000+ 30% of the income exceeding 250000
display the details of the employee.

You might also like