CBS Computer Application
CBS Computer Application
SECTIONA
(Attempt all questions from this Section)
Question 1 [20]
Choose the correct answer and write the correct option.
(i) promotes Reusability.
(a) Data Encapsulation
(b) Function Overloading
(c) Inheritance
(d) Data Abstraction
(ii) Automatic type conversion (implicit) is possible in which of the following cases?
(in) Identify the keyword among the following that makes a variable belong to a class rather than being
defined for each instance of the class
(a) abstract
(b) final
(cstatic
(d) neW
iv IfString str =
"
(a)
(b) Null
(C)true
dY "true
(a) String
(b) that
(c) this
(d) both (a) and (c)
statement terminates the complete execution of a program
(vi) Which of the following
(a) break
(b) exit
(c) System.exit(0)
(e) both (a) and (c)
13o1
code System.out.print(b+C+a) a0
be output of the
-
System.out.print (str.concat
str=null then what will be the output
(Vii) f
(a) nullKolkata
(b) Kolkata
(c) \u0000'Kolkata
(d) None of these
(a) 87
(b) 69
9
(d) None of these
(xvii) What will be the value of x when x=Integer.parseInt" 123")+ Integer.parseInt(" 123")
(a) 123
(b) 123123
(c) An Error occurred in runtime
(d) 246
(b) String
(c) boolean
(d) integer
Question2
(2
(a) Write down java expression for
Va2+b2+c2
X
[2+2]
Define the following with example
(b) (i) Access Specifier
() Data Encapsulaione
if-else and switch-Case Statement. (2
(c) Differentiate (at least 2) between (2]
to lowercase.
which will change a character
Write a single line code
(d) (2)
expression:
(e) Give the output of the following
10*a + (++a) -
String grade;
if(score> = 80)
grade ="A";
else if (score>= 70)
grade = "B";
else
grade = "D";
2 3
45 6
7 89 10
11 12 13 14 15
(Class, Member data, Member functions, Main function are not needed. Write only a function which will
take the limit of the triangle as formal parameter and print the above triangle. Example:- void
SECTIONB
(Attempt any four questions from this Section)
The answers in this section should consist of the programs in either Blue) environment or any program
environment with java as the base.
Each program in this section should be written using varíable description
Flowcharts and algorithms are not required.
[15]
Question3
Define a class called SECURITY with the following description:
Instance variables /Data members:
basis:
Therate is charged on the following Charges/Day
Days 5/hour
Up to 40 hours 6.5/hour
For next 20 hours 8/hour
Fornext 20 hours
Call the member
methods by using the object.
and create the object of the class.
Write a main function
Question 4
write a menu driven
Scanner class java
program
to
perform the following:(use switch-case statement) which will take a number
[15]
r Using
(1) Check the number fro
whether it is an
An Armstrong number is Armstrong number or
For example, 153 is an
an
integer such that the sum of thenot.cubes
of its
Armstrong number since 13 + 53+33
digits is equal to the number elf
=
153]
(2) Check the number whether
it is a Prime
Prime number which isnumber or not.
A number
is called a
divisible by itself and 1. For example 2, 3, 5, 7, 11
Question s5 etc.
Design a class to overload a function [15]
(a) void volume (double compared as follows:
n* radius2 *
radius, double height) -
Question 8 [15]
by using Scanner Class and encodes the word in PIGLATIN.
Write a java program to input a word from the user
Example:
Input: store
PIGLATIN ORESTAY
Output as
Input olympics
Output as PIGLATIN : OLYMPICSAY
****k**************k****k**