09-CTA
09-CTA
09-CTA
Class 9
This paper is divided into two Sections. Attempt all questions from Section A and any four
questions from Section B.
Question 1:
Choose the correct answers to the questions from the given options.
(Do not copy the question, write the correct answers only.)
1. Which is odd in given options
2. Assertion: Abstraction is the process of hiding the implementation details of an object and expressing
only the relevant features.
Reasoning: Abstraction allows you to focus on what an object does rather than how it does it. helps in
managing complexity.
(a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A
(b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion (A)
(e) Assertion (A) is true and Reason (R) is false
(d) Assertion (A) is false and Reason (R) is true
3. Which loop ends with a semicolon (;)?
a. for b. while
a. return b. break
c) Math.floor(-147.349) d) Math.max(64.5,65.4)
Question 2:
int y= (a > b ) ? a : b;
ii)Name the keyword that allows us to use classes from other packages.
int k = 5, j = 7;
k += k++ – ++j + k;
System.out.println(“k=” +k);
System.out.println(“j=” +j);
System.out.println("Java\"World\"");
System.out.println("Java\nWorld");
Section B (60 MARKS)
Question 3: [15]
Write a program to input a number and check if it is a Strontio number or not. Strontio numbers are those four
digits numbers which when multiplied by 2 give the same digit at the hundreds and tens place. The user should
be forced to input a four-digit number.
Example: Input muber: 1386
1386*2=2772, we observe that at tens and hundreds place digits are the same. Hence, 1386 is a strontio number.
Question 4: [15]
Write a program to create a function isPronic() that inputs a number from the user checks whether the
number entered is a Pronic number or not and displays an appropriate message. A pronic number is a
number which is the product of two consecutive integers, that is, a number of the form n(n + 1).
Example- 6 is a pronic Number as 2x3=6
To calculate the product, it should call a function giveProduct() that returns the product of two
values passed to it.
Note: USE THE SAME FUNCTION NAMES AS GIVEN IN THE QUESTION.
Question5: [15]
Write a menu driven program to calculate and print the sum of each of the following series:
Question 6: [15]
Define a class Mobike with the following description:
Instance variables/data members:
Member functions/methods:
Create a function which accepts an integer as a parameter and prints the factorials of all numbers till the
parameter passed.
Input:
Parameter passed: 5
Output:
Factorial of 1=1
Factorial of 2=2
Factorial of 3=6
Factorial of 4=24
Factorial of 5=120
***********