Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In java why do I need to add a return centimeters;? My professor Didn't explain at all and ignored me lol. Here's the code: public
In java why do I need to add a return centimeters;? My professor Didn't explain at all and ignored me lol.
Here's the code:
public class ha { public static double calcFeetAndInchesToCentimeteres(double feet, double inches) { if((feet < 0 || ((inches <0) && (inches >12)))) { return -1; } double centimeters = (feet*12) * 2.54; centimeters += inches * 2.54; System.out.println("feet" + feet + inches + centimeters); return centimeters; } }
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