Question: JAVA 5. Name three exception handling techniques. Explain and provide examples. (6 points) 6. What is the output of the following java code? Explain your
JAVA
5. Name three exception handling techniques. Explain and provide examples.(6 points)
6. What is the output of the following java code? Explain your answer. (5 points)
final double PI = 3.14159; double[] cylinderRadii = {3.5, 7.2, 10.5, 9.8, 6.5}; double[] cylinderHeights = {10.7, 6.5, 12.0, 10.5, 8.0}; double[] cylinderVolumes = new double[5]; for(int i = 0; i < 5; i++) cylinderVolumes[i] = 2 * PI * cylinderRadii[i]
* cylinderHeights[i]; for (int i = 0; i < 5; i++) System.out.printf("%d %5.2f %5.2f %7.2f %n", (i + 1), cylinderRadii[i], cylinderHeights[i],
cylinderVolumes[i]);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
