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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started