0% found this document useful (0 votes)
108 views3 pages

Java Programming Exam Questions

This document provides instructions for a computer applications theory exam consisting of 2 sections with a total time allotment of 1 hour and 15 minutes. Section A has 4 questions worth 40 marks total. Section B has 4 questions worth 60 marks total, where students must write a program to answer each question in Section B. The summary is: 1. The exam paper is divided into 2 sections - Section A with 4 short answer questions worth 40 marks total, and Section B with 4 programming questions worth 60 marks total. 2. Students have 1 hour and 15 minutes total to complete the exam, with the first 15 minutes for reading the paper and the remaining time for writing answers. 3. Section B requires writing a program

Uploaded by

Deepali Koirala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views3 pages

Java Programming Exam Questions

This document provides instructions for a computer applications theory exam consisting of 2 sections with a total time allotment of 1 hour and 15 minutes. Section A has 4 questions worth 40 marks total. Section B has 4 questions worth 60 marks total, where students must write a program to answer each question in Section B. The summary is: 1. The exam paper is divided into 2 sections - Section A with 4 short answer questions worth 40 marks total, and Section B with 4 programming questions worth 60 marks total. 2. Students have 1 hour and 15 minutes total to complete the exam, with the first 15 minutes for reading the paper and the remaining time for writing answers. 3. Section B requires writing a program

Uploaded by

Deepali Koirala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Computer Applications

(THEORY)
(Too Hours)
Answer to this
Ou willPaper must be written on the paper provided separately.

Thehe time This t e allowed to write answer for the first 15 minutes.
given at
1s to
the head be spent on reading the question paper.
of this
Or
paf is the time allowed for writing the
paper answer

Attempt all his


paper is divided into two
questions
intended marks from section A ny foursections.
for questionsons or
questions from section B.
parts of questions are given in brackets I 1.

SECTION A (40 Marks)


While
indicate briefly Attempt all questions
answering
your workingquestions from this part,
Q.1. (a) List all and
logical operators reasoning,
easoning, wherever requ red.
b)Explain the following used in
java. Wneev
()What
employee staff =
new statement: 2
)
will the
Math.min following
employee()
function return
(i) (-17-19
Math.floor (7.8 ) ); when executed? 2
(d) What is the
difference between an
controlled loop?
(e) What is the
entry controlled
loop and an
[2
exit
difference between the
Q.2. (a) char m =
"A; operators '/ 'and '% [21
in
int p =15; java? [21
What will be the
output of the
System.out.println(m+p) statement?
System.out.print.ln("Answer
(b) What do you understand :"+m+p);
(c) What will be the by JVM? 2
(i) float
output p=8/3, if p is
of [2
(d) Write an equivalent (ii) int
java expression for 2
(i) s ut + at2
=

2 (ii) d P +b2
eDistinguish between debugging and compiling. 2
[2
Q.3. (a) Explain pre increment and post increment with an
(b) Give an example of real world object. Mention twoexample. 3
characteristics and two
bahaviours of that object.
(c) Write a java statement each:
(1) to create an array which stores 25 real numbers.
(ii) to create an array which stores vowels of English alphabet. 2
d) Differentiate a function from a constructor. [21
(e) Write the following statement using switch case construct
if (a = = 1)
b+ =10;
System.out.println(b);
elseif(a= =2)

b- =10;
System.out.println(b}
else

b=a;
System.out.println(b);
41
(f) What is the difference between "public" access specifier and "private a
specifier? (2
(g) Predict the output:
() char p=
(ii) int
"COMPUTER".charAt(4);
k=65;char m=(char)k; 4

SECTION B (60 Marks)


Attempt any four questions from this Section.
ne anstoer n this section should consist of the Program either in Bluej environment or any

program enOironment with Java as the base. Each program should be written ustig
variable description/Mnemonic Codes so that the logic of the program is clearly depictea.
Flow Charts and Algorithms are not required.

Q.4. A Bank announces a new tariff in Term Deposit Schemes for their customers and
Senior Citizenship accordingly:
Term Rate of Interest Rate of Interest (Senior
(General) Citizen)
Up tol year 7.5% 8.0%
Up to 2 years 8.5 % 9.0%
Up to 3 years 9.5 % 10.0%
More than 3 years 10.0% 11.0%

The Senior Citizen is applicable to those


customers, whose age is 60 years or
more. Write a program to accept the sum
(p) in term deposit scheme, age of
the customer and the term. The
program displays the information in the given
format:
Sum Assured Term Age Interest earned Amount Paid
XXx XXX XXX XXX

Q.5. Write a menu driven program to


XXX
[15
accept number from the
a
user and check
whether it is a
Composite number or a Duck number.
(1) Composite number number
:
(A is
said to be
factors other than 1 andcomposite,
if it has more
itself).
composite number. The factors are: Example:
18 is a
1,2,3,6,9,18
ii) Duck number
Duck number is the number, which contains at
least

its
digits 0 digitmust not begin
Ot as (zero). A
with zero.
Example: 8301 is a Duck number. 151
o.6. A string is said to
be
"Unique', if none of the alphabets present in thee ar e
strug
repeated. Write a program to accept a string and check whether the string
Unique or not. The
program displays a message accordingiy.
Sample Input: COMPUTER
Sample Output: Unique String [15]
0.7. Write a progranm using method name Glem(int.int) to find the Lowest Comrnor
Multiples (LCM) of two numbers by GCD (Greatest Common Divisor) ot te
numbers. GCD of two integers is calculated by continued division method. Diviue
the larger number by the smaller, the remainder then divides the previous dviso
The process is repeated till the remainder is zero. The divisor then results u

GCD.
Product of two numbers
LCM =
GCD
Write the main method to display the LCM of two numbers. [15]
Q.8. Write a program to store Index Number, Name and Date of birth of all i e

ICSE Examination in three different Single


students of your school appearing for in
Dimensional Arrays. Process the data in such a way that the output appears
below:
alphabetical order of their names under appropriate headings as given
Index No. Name Date of Birth
xXxxXxxxX XXXXXXX XXXXXXXXX

XxxxXXXx xXXXXXX XxxxXXXXX

XXXXXXXx XXXXXXXXX
[15]
xXXXXXKXx

below:
Q.9. Define a class Employee described as

Data members/instance variables:

name, empno, basic, da,hra,gross, tax;


Member Methods:
constructor to initialize the data members
(i) A parameterized
(ii) To accept the details of an employee
annual salary exceeds 7 1,80,000 then
(iii) To compute the annual salary. If the
Tax".
"Income Tax to be paid" otherwise, "No Income
da-30% of basic
hra=15% of basic
gross = basic + da+ hra
annual salary = 12*gross
(iv) To display the name, empno, annual salary along with the message
Write a main method to create an object of a class and call the above member

methods.
[15]

You might also like