Write java programs for the following:-
1. Write a program in Java to calculate and display the hypotenuse of a Right-Angled Triangle by taking perpendicular and base as inputs.
Hint: h = √p2 + b2
2. Write a program to input two unequal positive numbers and check whether they are perfect square numbers or not. If the user enters a negative number then the program displays the message 'Square root of a negative number can't be determined'.
Sample Input: 81, 100
Sample Output: They are perfect square numbers.
Sample Input: 225, 99
Sample Output: 225 is a perfect square number.
99 is not a perfect square number.
3. The volume of solids, viz. cuboid, cylinder and cone can be calculated by the formula:
1. Volume of a cuboid (v = l*b*h)
2. Volume of a cylinder (v = π*r2*h)
3. Volume of a cone (v = (1/3)*π*r2*h)
Using a switch case statement, write a program to find the volume of different solids by taking suitable variables and data types.
Answers
Answered by
0
Answer:
Write a program in Java to calculate and display the hypotenuse of a Right-Angled Triangle by taking perpendicular and base as inputs.
Hint: h = √p2 + b2
2. Write a program to input two unequal positive numbers and check whether they are perfect square numbers or not. If the user enters a negative number then the program displays the message
Explanation:
please mark me Brainlist I have to reach genius rank
Similar questions