Gr9 Term2 Project Ques - 1-20
Gr9 Term2 Project Ques - 1-20
Gr9 Term2 Project Ques - 1-20
5
54
543
5432
54321
A
BB
CCC
DDDD
EEEEE
3) Write a program in Java to input three numbers and display the greatest and the
smallest of the two numbers.
Hint: Use Math.min( ) and Math.max( )
Sample Input: 87, 65, 34
Sample Output: Greatest Number 87
Smallest number 34
5) Write a program to input the time in seconds. Display the time after converting
them into hours, minutes and seconds.
Sample Input: Time in seconds 5420
Sample Output: 1 Hour 30 Minutes 20 Seconds
6) In an examination, you have appeared for three subjects i.e. Physics, Chemistry
and Biology. Write a program in Java to calculate the average mark obtained and
finally display the marks in rounded-off form.
Take Physics, Chemistry. and Biology marks as inputs.
8) Write a program to input a number and evaluate the results based on the
number entered by the user:
(a) Absolute value of the number
(b) Square root of the number
(c) Cube of the number
*
*#
*#*
*#*#
*#*#*
11) Write a menu driven program to display all prime and non-prime numbers from 1
to 100. Enter 1: to display all prime numbers Enter 2: to display all non-prime
numbers Hint: A number is said to be prime if it is only divisible by 1 and the
number itself.
14) Write a program to generate all perfect numbers between 1 and 100.
15) Write a program to generate all 3 digit palindrome numbers.
16) Write a program to input a number and check whether it is a magic number or
not. If you iterate the process of summing the squares of the decimal digits of the
number, and if this process terminates in 1, then the original number is called a
magic number. For example, 55=>(5+5)=10=>(1+0)=1.
17) Write a program to input 10 integers and find the sum of the prime numbers
only.
18) Write a program to generate all perfect numbers between 1 and 100.
I would like to thank my Computer teacher Ms.Neelima Vadnere for giving me the
opportunity to make this project. While making this project, I learned new things
about programming in Java.
I would like to thank my parents who helped me in the completion of this project
on time and aided me in presenting it in a neat manner.
Finally, I would like to thank my school, Vibgyor High Magarpatta, for providing
me with proper education and enabling me with the necessary facilities for
learning Computer Applications.