Computer Operator
Computer Operator
OPERATORS
Marks:
a. System.out.println("Java");
b. cp=45.50;
c. gp++;
d. Car hybrid=new Car();
If(x%2==0)
System.out.println(“even”);
Else
System.out.println(“odd”);
a) Object
b) thing
c) Class
d) none of these
17. Objects interact with each other through 1 mark
a)signals
b)methods
c) titles
d) none of these
18. An object has 1 mark
a) Behaviour
c) state
b) attributes
d) all of these
19. A class shares common 1 mark
a) Behaviour
b) properties
c) relationship
d) all of these
20. A class name must begins with______ letter 1 mark
a) Capital
b) small
c) ASCII
d) none of these
21. _______ keyword is used to create class 1 mark
a) new
b) class
c) dot
d) all of these
22. If m,n,p are three integers, then which of the following holds 1 mark
true?
If(m==n) && (n!=p)?
a)m and n are not equal
b)n and p are equal
c)m and p are equal
d) m and p are not equal
23. . A Class is also known as ..............data types. 1 mark
a. User-defined
c. Pre-defined
b. Abstract
d. None
24. Minhas is writing an OOP code for items like car, truck, bus 1 mark
etc. These items under the class vehicle are called...
a. Items
c. Methods
b. Attributes
d. Objects
25. When the value of a variable is increased by one before the 1 mark
result of the expression is evaluated, it is called
a.Postfix increment
b. Prefix decrement
C. Prefix increment
d. Postfix decrement
SECTION B
(Variable table is compulsory)
1. Write a program to display the multiplication of any 15
given number. marks
2. Write a program in java to print your address details 15
in the following format: marks
House number:
Street name:
Landmark:
City:
State:
Mobile number:
3. The daily wages paid to a labourer is 100/day. He 15
works 1 day in first week, 3 days in second week, 4 markd
days in third and 7 days in fourth week. Write a
program of class name gross pay and compute the
payment he gets in the month.
4. Write a program to input two numbers a, b and if 15
display the square of a, otherwise square of b, using marks
ternary operator