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

CH 5-6 Questions

The document is an ICSE Class 9 Computer Applications practice question paper covering two chapters: Input in Java and Mathematical Library Methods in Java. It consists of various question types including short answer, output-based, programming, error correction, and application-oriented questions, totaling 70 marks. Answers are provided at the end, and the paper is structured to align with the ICSE examination pattern.

Uploaded by

saptarshirina
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)
4 views4 pages

CH 5-6 Questions

The document is an ICSE Class 9 Computer Applications practice question paper covering two chapters: Input in Java and Mathematical Library Methods in Java. It consists of various question types including short answer, output-based, programming, error correction, and application-oriented questions, totaling 70 marks. Answers are provided at the end, and the paper is structured to align with the ICSE examination pattern.

Uploaded by

saptarshirina
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

Certainly!

Below is a detailed ICSE Class 9 Computer Applications Question Paper based


on the following two chapters:

1.​ Input in Java


2.​ Mathematical Library Methods in Java

It is structured for 70 marks, includes a mix of short answer, programming, and


application-based questions, and adheres to the ICSE pattern. Answers are provided at the
end.

📝 ICSE Class 9 – Computer Applications


Practice Question Paper​
Max Marks: 70​
Time: 2 hours

Instructions:

●​ Attempt all questions.


●​ Show working wherever necessary.
●​ Answers should be written neatly.

Question 1: [10 Marks]


(Short Answer Questions)​
Answer the following questions briefly:

a) What is the use of the Scanner class in Java?​


b) Differentiate between next() and nextLine() methods.​
c) What does the method Math.sqrt(64) return? State the data type of the result.​
d) How can you round a number up to the next integer using a Math method?​
e) Write the output of the following:

System.out.println(Math.max(45, 89));
System.out.println(Math.abs(-15));
Question 2: [10 Marks]
(Output-Based Questions)​
Write the output of the following code snippets:

a)

import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
System.out.println(Math.pow(x, y));
}
}

Input: 2 3

b)

System.out.println((int)(Math.random() * 10) + 1);

c)

double a = 7.4;
System.out.println(Math.round(a));
System.out.println(Math.floor(a));
System.out.println(Math.ceil(a));

d)

System.out.println("Java" + 10 + 20);

e)

String s = "Hello";
System.out.println(s.length());
Question 3: [15 Marks]
(Programming Questions)​
Write complete programs for the following:

a) Write a program to input a user's name, age, and percentage marks. Display them in a
well-formatted output. [5]

b) Write a program that:

●​ Takes two numbers from the user


●​ Prints their sum, difference, and square root of the larger number using Math.sqrt()
[5]

c) Write a program to generate a random number between 1 and 100, and display it with a
message:​
"Your lucky number is: ___" [5]

Question 4: [10 Marks]


(Error Correction and Explanation)

a) Identify the error in the following code and rewrite it correctly:

Scanner sc = new Scanner;


int x = sc.nextInt;

b) What will happen if we call nextLine() immediately after nextInt()? How do we fix it?

c) Rewrite the following expression so that the result is in int:

double result = Math.pow(3, 2);

d) Rewrite this expression so that it rounds up the number 5.2 to the next integer:

Math.floor(5.2);

e) Write the import statement needed to use both Scanner and Math methods.
Question 5: [10 Marks]
(Application-Oriented Questions)

a) Write a program to input a temperature in Celsius and convert it to Fahrenheit. Use input and
Math functions appropriately. Formula: F = (C * 9/5) + 32 [5]

b) Write a program to input a number and check whether it is positive, negative or zero. Use
Math.abs() for displaying the absolute value in the output. [5]

Question 6: [15 Marks]


(Mixed Skills Programming)

Write a program that does the following:

●​ Takes three numbers as input from the user.


●​ Finds the largest and smallest using Math.max() and Math.min().
●​ Calculates and displays their average.
●​ Round the average to the nearest integer using Math.round().

You might also like