Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions

Question

=+8.3(i)). If j is transient, then fi= C PH) /(1+2 Pc)

Answered: 1 week ago