COMPUTER APPLICATION MCQ
COMPUTER APPLICATION MCQ
reading time), ALL QUESTIONS ARE COMPULSORY, , The marks intended for questions
are given in brackets [], Select the correct option for each of the following questions., ,
SECTION A (30 Marks), [5x1], . Which of the following is smallest integer data type?, , (A)
short, (B) Byte, (C) byte, (D) bit, , . A value of a type — like int- will always require the same
amount of, memory to store one value., , a. Basic c. Primitive, b. Double d. None of
these, , . What is meant by access specifier “default” in a method definition?, , a. Accessible
only within the class, , b. Accessible by any other class anywhere, , Accessible to classes in
the same package but not by classes in other packages, None of these, , af, , . Which of the
following types of functions does not return a value?, , a. Pre method c. Specific method, b.
Mutator method d. None of these, , . Aconstructor that takes no arguments and has a body
that does nothing is called: a. Default constructor, , b. Invoked constructor, , c. Parametrized
constructor, d. None of these, , 6. What will be the output of the following code?, int c =
(3<4)? 3*4:344;, , a 7, b. 12, ec 19, d 2.5, , 7. A Java program developed and executed by
the users without using web browser is, known as:, , a. application c. object, b. applet d.
none, , 8. Java is a case sensitive language. Which is the most appropriate statement with
respect to, this context?, , Upper and lower case letters are distinguished., Upper and lower
case letters are ignored., Only lower case letters are distinguished., None., , RBege, , 9. An
object is said to be a, data., , a. non-primitive ec. basic, b. primitive d. None, , 10. Division
by a variable that contains a value zero is called. error., , a. compile ec. BothA andB, , time
d. None, b. run time
11. What will be the output of the following code snippet?, System.out.printIn(Math.floor(-
4.7));, , (A) -8.14, (B) 22.09, (C) -5.0, , (D) None, , 12, What will be the output of the
following code snippet?, System.out.printin(Math.ceil(3.4)+Math.pow(2,3));, , (A) 11.0, (B)
12.5, (C) 12.0, (D) None, , 13. Which returns the cube root of its argument as a double
value., a. Math.cbrt(), b. Math.cuberoot(), c. Math.rootcube, d. None, , 14. A compound
statement can be stated as, , a. p=in.nextint(); q=in.nextint();, b. m=++a;, n=--b;, c. if(a>b),
{at++:b--;}, d. none, 15. if(a<b) c=a; else c=b, It can be written as:, a. c= (b<a)?a:b;, (B) c=
(a!=b)?azb;, (C) c= (a<b)?b:a;, (D) none, , 16. Predict the output of the following code
snippet:, int a=1,b=2,c=3;
Page 4 :
switch(p), , {, , case |: at++;, case 2: ++b;, break;, , case 3: c--;, , }, , System.out.printin(a +
","+ b +"," +c);, , Tf the value of P =1, then find the output:, (A) 2,33, , (B) 4,5,5, , (C) 5,6,6, ,
(D) None, , 17. What will be the output of the following code?, , int m=2;, , int n=15;, , for(int
i=1;1<5;i++), , m++;, , --n;, System.out.printin("m="+m);, System.out.printin("n="+n);, , (A)
m=6 (Cc) m=20, n=14 n=15, (B) m=17 (D) None, n=19, 18. A class is called an because it
creates objects and uses them., , a. Object destructor, b. Object modifier, , c. Object factory,
d. Object updater, , 19. Suppose num! and num2 are two double type variables that you
want to add, as an integer form and assign to a variable res of type int. Choose the correct,
statement for given task., , a. res = (int) (numl+num2);
Page 5 :
b. res = numl+num2;, c. res = (double) num!+num?;, d. res = (long) num!+num2;, , 20.
statement will repeat a loop for the next iteration after ignoring some, statements of the
loop., , a. break, , b. continue, ec. default, d, None, , 21. Which of the following are valid
identifiers?, , (i) Games, , (ii) flag, , (iii) INCOME_TAX, (iv) Break, , 1. (i) & (iii), , 2. (iii) & (iv),
, 3. All of the above, 4. None of the above, , 22.A____ function does not change or modify
the state of their parameters, received., a. pure, b. impure, c. actual, d. None, , 23. What
type of casting shown by the following examples?, , double x=15.2; int y=(int) x;, a. Implicit
c. Both first and second options, , b. Explicit d. None, , 24. What is the range of byte data
type in Java?, , (A) -128 to 127 (C) -2147483648 to 2147483647, (B) -32768 to 32767 (D)
None of the mentioned
Page 1 :
Computer Applications-X-term2, , Time | hour, Marks50, , Section A (25 marks), , Question -
1, , (a) 1., , (b) 2, A constant is also called, A. Variable, , B. Literal, , C. Identifier, , D.
Character, , A word used in a high level language which has a special, , meaning attached
to it is called, , (c) 3., , A Class, B. Identifier, Cc. Keyword, , D. Literal, , A character literal is
assigned to a:, A. Char variable, , B.Char type literal, , C. String variable, , D String literal, ,
(d) 4. Aset of characters is assigned to:
Page 2 :
A. String variable, B. Static variable, C. Boolean variable, , D. None, , (e) 5. Which of the
following results in integer type?, A. 11.4F/C.2D, B. 1C.8variable, Cc. 12/3, , D. None, ,
Question -2, , (a)6. Boolean Data is used to test a particular condition i.e. true or, false., ,
Which of the following is a correct representation?, A. boolean m=true, , B. boolean
m='true’, C. boolean m="true", , D. None, , (b) 7. double c; int x, y, z; x = 5; y = 10; z= 11; c
= x*y+z/2; The value, stored in c is:, , A. 55.0, B. 55.5, c.55
Page 3 :
D. None, , (C)8. -Which of the following is a compound statement?, , A.
p=Integer.parselnt(in.readLine());, B. c=++a;, , C. if(a>b) {a++; b- -; }, , D. a=4;, , (d) 9. Two
arithmetic expressions can be compared with if, statement, using:, , A. Arithmetic operator,
B. Relational operator, C.Ternary operator, , D. None, , (e) 10. A Java program executes
but doesn't give the desired output., It is due to:, , A. logical error, B. syntax error, C. run
time error, D. none, , Question —3, , (a)11. Inheritance supports, A. Interface, , B.
Reusability
Page 4 :
C. Restructuring, , D. All of these, , (b) 12.-A type of parameter that are used in the function
defination, :A. Formal parameter, B. Actual parameter, C. Both 1 and 2, , D. None of these, ,
(c) 13-The parameter list in a function definition is called:, A. Function prototype, B.
Function signature, C. Both 1 and 2, , D. None of these, , (d) 14. The number of values that
a function can return is:, A.1, B.2, C.3, D.4, (e) 15. -A local variable in a function has its
scope:, A. Limited within the function, B. Can be accessed anywhere within the same
class, , C. No limitation at all
Page 5 :
D. None of these, , Question -4, , (a)16. SWITCH statement accepts __ type of data as,
input., A. byte, B. short, Cc. int, D. All, , (b) 17. switch statement in Java accepts __ as input
data., A. enum, B. String, C. enum and String, D. Long, , (c) 18. What is the output of the
Java program below?, String animal = "cow";, switch(animal), , {, break:
System.out.printin("DOMESTIC");}, , A. No output, , B. Boat, , C. GOAT DOMESTIC, D.
Compiler error, , (d) 19. -What is the output of the below Java program?, int persons =
45;int random = 45;, switch(random){, case persons: System.out.print("CRICKET ");,
default: System.out.printin("RUGBY");}
Page 1 :
UNIT TEST - 8, Question - 1, Design a class to overload a function series() as follows:, , (a)
void series(int x, int n): to display the sum of the series given, below:, , x +74 x? +... 4x"
terms, , (b) void series(int p): to display the following series:, , 0, 7, 26, 63, ... p terms., , (c)
void series(): to display the sum of the series given below:, , 1/2 +1/3+1/4+...+ 1/10., , class
Overload2019, {, , public void series(int x, int n){, double sum = (1), for(inti=(2) 5 1(3)__ ss
i++), {, , sum=sum+(4) ;
Page 2 :
}, , System.out.printin("Sum of series is " + sum);, , }, public void (5)--------(int p), {, int
term=0;, for(inti=(6)_ 5 i<=(7)___; i++), {, term = (int)(Math.pow(i, 3)-1);, ,
System.out.print(term + ",");, , }, }, public void series(), {, double (8) = 0.0;, , for(inti=(9)___;
i<= 10; i++), sum = sum+ (10), , System.out.printin("Sum of series is " + sum);
Page 3 :
}, , /**main function to run this program, public static void main(String args[]), , {,
Overload2019 ob = new Overload2019();, , ob.series(2,4);, ob.series(3);, ob.series();, , }*/, ,
1. A.0.0D, B. 0.0F, C. OL, , D.O, , 2. A.l, B.0, C.N, , D. None
Page 4 :
3. A.>=n, B. <=n, C. <n, , D.=n, , 4. A. Math.pow(x, i);, B. math.pow(x, i);, C.x, D.i, , 5. A.
Series, B. series1, C. series, , D. none, , 6. A.1, , B.p, c.0, , D.n
Page 5 :
7. A.1, B. p, c.0, D.n, , 8. A. Sum, B.s, Cc. sum, D.S, , 9. A.l, B.2, c. 10, , D.n, , 10. A. 1.0 /
i;, B.1/i;, C.1/1