0% found this document useful (0 votes)
27 views4 pages

Class 9icese

The document outlines an exam for Class 9 Computer Applications, consisting of multiple-choice questions and programming tasks. It covers topics such as loops, data types, error handling, and specific programming challenges like temperature conversion and magic numbers. The exam is designed to assess students' understanding of Java programming concepts and their ability to apply them in practical scenarios.
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)
27 views4 pages

Class 9icese

The document outlines an exam for Class 9 Computer Applications, consisting of multiple-choice questions and programming tasks. It covers topics such as loops, data types, error handling, and specific programming challenges like temperature conversion and magic numbers. The exam is designed to assess students' understanding of Java programming concepts and their ability to apply them in practical scenarios.
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/ 4

CLASS 9

COMPUTER APPLICATION EXAM 2K25


Full Marks:80 Time Allowed:2 hour
SECTION A
Question 1 [10]
(i) Among the following which is a keyword: (a) every (b) all (c) case (d) each
(ii) Give the output of Math.ceil(-0.6) : (a)-1.6 (b) -1.5 (c)-1.0 (d)-0.0
(iii)How often is the inner loop of a nested loop run? (a) Forever (b) One fewer
time than the main loop (c) Each time the main loop is run (d)One more time
than the main loop
(iv) What’s wrong? for (int k = 2, k <= 12, k++) (a) the increment should always
be ++k (b) the variable must always be the letter i when using a for loop (c)
there should be a semicolon at the end of the statement (d) the commas
should be semicolons
(v) A type of loop that is usually used when the number of iteration is known.
(a) for (b) while (c) do-while (d)None of these
(vi) An if statement inside another if statement is called ______. (a) Nested if
(b) Internal if (c) Concentric if (d)None of these
(vii) What is the problem called in which an optional else clause in an if–
then(–else) statement results in nested conditionals being ambiguous? (a)
Dangling if (b) Dangling else (c) Both a and b (d)None of these
(viii) Which among the following will yield -1 for negative number and 1 for
positive number for a number stored in a variable a? (a) Math.abs(a)*a (b)
Math.abs(a) / a (c) Math.ceil(a) / Math.floor(a) (d)None of these
(ix) If the data that is to take part in a calculation in a method is fixed, which
form of input is necessary? (a)Initialisation (b) Parameterised input
(c)Scanner input (d)None of these
(x) Which among the following is the correct construct for creating an object
named ‘book’ of the ‘Library’ class? (a)Library book=new Library; (b)book
=new Library(); (c) Library() book=new Library();(d)Library book=new
Library();
Question 2 [30]
(i) int var = ‘A’ What is the value of var? [1]
(ii)Identify whether they are primitive or non-primitive types (a) String (b)
arrays (c) char (d) classes [2]
(iii)Given the initial value of a = 10, k = 2 in the following expression : k+ =
a++ + ++a/2;Write the final value in k and a [2]
(iv)What are comments? Give example. [2]
(v)Write the output of the following code :for ( k = 100; k > 55; k= k – 5){if (
k%2 = = 0){continue ;}System.out.print(k + ” “);} [2]
(vi) Rewrite the following using if ..else construct switch ( hi )
case 25 : System.out.print (“Yellow”); break; default: System.out.print
(“Purple”); [2]
(vii) Identify the mistake in each of these lines and correct it: (a) int
goto=5; (b) String s= ‘Computer’; [2]
(viii) What are counters? [1]
(ix) Find output: class Output4
{
static void main()
{
int a=12,b=13,c;
c=a++ + ++a/7 + b++;
System.out.println(a+“\t”+b+“\t”+c);
c=++a + a++/3 + ++b;
System.out.println(a+“\t”+b+“\t”+c);
}
} [2]
(x) What are the different type of errors in a Java program? [2]
(xi) Math.ceil(-12.56) + Math.floor(15.36) [2]
(xii) What is the value of y after evaluating the expression given below?
y += ++y + y– + –y; when int y = 4. [2]
(xiii) The output of Math.round(6.6) + Math.ceil(3.4) is? [2]
(xiv) Rewrite the following using while loopfor ( m = 75; m >= 50 ; m = m -
10)System.out.print( k + " " ); [2]
(xv)Define polymorphism with an example [2]
(xvi) State the difference between = and = =. [1]
(xvii) Differentiate between if and switch statements. [2]

SECTION B
(ATTEMPT ANY 4)
Question 3
Using a switch statement, write a menu driven program to convert a given
temperature from Fahrenheit to Celsius and vice versa. For an incorrect
choice, an appropriate error message should be displayed.(HINT : C
=5/4×CF − 32 ) and F = 1.8 × C + 32 [10]
Question 4
A cloth showroom has announced the following festival discounts on the
purchase of items, based on the total cost of the items purchased: [10]
Total cost Discount(%)
Less than 1000 No discount
1001 to 2999 10%
3000 to 4999 15%
More than 5000 30%

Question 5
Write a program to input an integer and check whether it is a magic number
or not. A Magic number is such a number whose continous sum of the digits
until it forms a single digit is 1. For example [55]=5+5=[10]=1+0=[1] ,
therefore 55 is a Magic Number. (Remember no loops is to be used). [10]
Question 5
A gameshop charges ps5. Following are the charges:
First five days : 2500rs/day.
Six to Ten days : 3500rs/day.
Ten to fifteen days: 4500rs
Above fifteen days : 6000 rs/day. Design a program to calculate the charges
assuming that a ps5 will be returned after N days. [10]

Question 6
Find the sum of the series.
S = (X+1)2+(X+2)3+(X+3)4+(X+4)5+…………… +(X+N)N+1 [10]

Question 7
Write a program to pass an integer as argument and check whether it is
Armstrong number or not. Numbers whose sum of the cube of its digit is
equal to the number itself is called Armstrong numbers. Example 153 =13
+53 +33 . [10]

You might also like