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

Class 9 Programming Practise Sets of Progrms 12012025

Uploaded by

mdnizaaaaam
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)
10 views3 pages

Class 9 Programming Practise Sets of Progrms 12012025

Uploaded by

mdnizaaaaam
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

Class 9

Computer Mock Test


Date: 05.01.2025 Time: ____
Name: _____________
Marks Obtained: _____________
Remarks: _____________

Java Programming
SI No Question Answer
1 Convert Fahrenheit to Celsius

Write a Java program to convert temperature


from Fahrenheit to Celsius degrees.
Test Data
Input a degree in Fahrenheit: 212
Expected Output:
212.0 degree Fahrenheit is equal to 100.0 in
Celsius

F → oC = (F − 32) × 5/9 = C

2 Write a Java program to convert minutes into


years and days.

Test Data
Input the number of minutes: 3456789
Expected Output :
3456789 minutes is approximately 6 years and
210 days

3 Sum and Average of 5 Numbers


Write a program in Java to input 5 numbers
from the keyboard and find their sum and
average.
Test Data
Input the 5 numbers : 1 2 3 4 5
Expected Output :
Input the 5 numbers :
1
2
3
4
5
The sum of 5 no is : 15
The Average is : 3.0
4 Multiplication Table of a Number
Write a Java program to display the
multiplication table of a given integer.

Test Data
Input the number (Table to be calculated) :
Input number of terms : 5
Expected Output :
5X0=0
5X1=5
5 X 2 = 10
5 X 3 = 15
5 X 4 = 20
5 X 5 = 25
5 Write a Java program to display the pattern
like a right angle triangle with a number.

Test Data
Input number of rows : 10
Expected Output :
1
12
123
1234
12345
123456
1234567
12345678
123456789
12345678910

6 Right-Angle Triangle with Incrementing


Numbers

Write a Java program to make such a pattern


like a right angle triangle with the number
increased by 1.

The pattern like :

1
23
456
7 8 9 10
7 Pascal's Triangle

Write a Java program to display Pascal's


triangle.

Test Data
Input number of rows: 5
Expected Output :

Input number of rows: 5


1
11
121
1331
14641

8 Reverse * Triangle

Write a Java program to generate the following


* triangles.

Test Data
Input the number: 6
Expected Output :

******
*****
****
***
**
*

You might also like