Write a second convertTolnches0 with two double parameters, numFeet and numinche
ID: 3917254 • Letter: W
Question
Write a second convertTolnches0 with two double parameters, numFeet and numinches, that returns the total number of inches. Ex: convertTolnches(4.0, 6.0) returns 54.0 (from 4.0 12+ 6.0). 1 import java.util.Scanner; 3 4 public class Methodoverlood 5 public double convertToInches(double numFeet) return numFeet 12.0; 9*Your solution goes here 10 1 public static void main (String args) 12 13 14 15 16 17 18 double totalInches; MethodOverload measuringTape - new MethodOverload totalInches measuringTape.convertToInches(4.0, 6.0) System.out.println"4.0, 6.0 yields " totalInches) totalInches measuringTape.convertToInches(5.9); System.out.println("5.9 yields "+ totalInches);Explanation / Answer
public double convertToInches(double numFeet,double numInches){
return numFeet*12.0+numInches;
}
For any query please comment.
Please upvote if find it helpful.
Thank you.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.