0% found this document useful (0 votes)
2 views1 page

Functions Questions

The document contains a series of programming questions focused on Java methods, including computing averages, checking evenness, determining if a number is a palindrome, and using various Math class methods. It also includes a hint for calculating the sum of digits in an integer. Additionally, there are links to join Telegram groups for further study resources.

Uploaded by

ADITYA MISHRA
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)
2 views1 page

Functions Questions

The document contains a series of programming questions focused on Java methods, including computing averages, checking evenness, determining if a number is a palindrome, and using various Math class methods. It also includes a hint for calculating the sum of digits in an integer. Additionally, there are links to join Telegram groups for further study resources.

Uploaded by

ADITYA MISHRA
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

FUNCTIONS QUESTIONS

Question 1 : Write a Java method to compute the average of three numbers..

Question 2 : Write a method named isEven that accepts an int argument. The method
should return true if the argument is even, or false otherwise. Also write a program to test
your method.

Question 3 : Write a Java program to check if a number is a palindrome in Java? ( 121 is


a palindrome, 321 is not)
A number is called a palindrome if the number is equal to the reverse of a number e.g., 121 is
a palindrome because the reverse of 121 is 121 itself. On the other hand, 321 is not a
palindrome because the reverse of 321 is 123, which is not equal to 321.

Question 4 : READ & CODE EXERCISE


Search about(Google) & use the following methods of the Math class in Java:
a. [Link]( )
b. [Link]( )
c. [Link]( )
d. [Link]( )
e. [Link]( )
f. [Link]( )

Free reading resource ([Link]


Please feel free to look for more resources/websites on your own.

Question 5 :
Write a Java method to compute the sum of the digits in an integer.

(Hint : Approach this question in the following way :


a. Take a variable sum = 0
b. Find the last digit of the number
c. Add it to the sum
d. Repeat a & b until the number becomes 0 )

Join our Telegram : [Link]


Join our Telegram : [Link]

You might also like