answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Dominik [7]
1 year ago
10

Write a second convertToInches() with two double parameters, numFeet and numInches, that returns the total number of inches. Ex:

convertToInches(4.0, 6.0) returns 54.0 (from 4.0 * 12 + 6.0).FOR JAVA PLEASEimport java.util.Scanner;public class FunctionOverloadToInches {public static double convertToInches(double numFeet) {return numFeet * 12.0;}/* Your solution goes here */public static void main (String [] args) {double totInches = 0.0;totInches = convertToInches(4.0, 6.0);System.out.println("4.0, 6.0 yields " + totInches);totInches = convertToInches(5.9);System.out.println("5.9 yields " + totInches);return;}}
Computers and Technology
1 answer:
mixer [17]1 year ago
5 0

Answer:

   public static double convertToInches(double numFeet, double numInches){

       return (numFeet*12)+numInches;

   }

Explanation:

This technique of having more than one method/function having the same name but with different parameter list is called method overloading. When the method is called, the compiler differentiates between them by the supplied parameters. The complete program is given below

public class FunctionOverloadToInches {

   public static void main(String[] args) {

       double totInches = 0.0;

       totInches = convertToInches(4.0, 6.0);

       System.out.println("4.0, 6.0 yields " + totInches);

       totInches = convertToInches(5.9);

       System.out.println("5.9 yields " + totInches);

       return;

   }

   public static double convertToInches(double numFeet)

       {

           return numFeet * 12.0;

       }

       /* Your solution goes here */

   public static double convertToInches(double numFeet, double numInches){

       return (numFeet*12)+numInches;

   }

}

You might be interested in
In a particular field, there are trees in a l single row from left to right. Each tree has a value V You cut trees from left to
Sedbober [7]

Answer:

i dont know help me

Explanation:

4 0
1 year ago
Read 2 more answers
TQ Artificial Intelligence (AI)
dybincka [34]
Ask Elon Musk he knows
8 0
1 year ago
If you want to present slides to fellow students or coworkers which productivity software should you use to create them A. Word
mamaluj [8]
If you want to present the slides to fellow students or coworkers which productivity software should you use to create them-c.presentation
6 0
2 years ago
Read 2 more answers
The __________ vulnerability assessment is a process designed to find and document selected vulnerabilities that are likely to b
forsale [732]
The risk vulnerability assessment is the answer
5 0
2 years ago
When creating a table in the relational database design from an entity in the extended e-r model, the attributes of the entity b
larisa86 [58]
No.  The attributes of the table correspond to columns within the table.  Each unique set of attribute values taken together correspond to table rows.  Sometimes referred to as "records".

8 0
1 year ago
Other questions:
  • Which of the following is not a benefit of active listening?
    8·1 answer
  • Prove that any amount of postage greater than or equal to 64 cents can be obtained using only 5-cent and 17-cent stamps?
    15·1 answer
  • In 2–3 sentences, describe how you would change the background of a group of cell
    6·2 answers
  • Which key retains its uniqueness even after you remove some of the fields?
    14·1 answer
  • Write a program to determine all pairs of positive integers, (a, b), such that a < b < 1000 and [a2 + b2 + 1)/(ab) is an i
    13·1 answer
  • Which of the following is not true about VOIP?
    9·1 answer
  • Create a generic class Box with a type parameter that simulates drawing an item at random out of a box. This class could be used
    7·1 answer
  • For a class project, Jerome builds a simple circuit with a battery and three light bulbs. On his way to school, Jerome drops his
    9·1 answer
  • A line graph titled Unemployment Percentages and Levels of Education where the x-axis shows dates from November 2007 to November
    11·1 answer
  • 2. BIOS is contained in ROM and not in RAM. Can you guess why?​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!