Ask Question

Define a function print total inches, with parameters num_feet and num_inches, that prints the total number of inches. Note: There are 12 inches in a foot. Sample output with inputs: 5 8 Total inches: 68

+4
Answers (1)
  1. 19 June, 18:33
    0
    public static void printTotalInches (double num_feet, double num_inches) {

    double inches = 12*num_feet;

    System. out. println ("Total value in feets is: " + (inches+num_inches));

    }

    This function is written in Java Programming Language. Find a complete program with a call to the function in the explanation section

    Explanation:

    public class ANot {

    public static void main (String[] args) {

    //Calling the function and passing the arguments

    printTotalInches (5,8);

    }

    public static void printTotalInches (double num_feet, double num_inches) {

    double inches = 12*num_feet;

    System. out. println ("Total value in feets is: " + (inches+num_inches));

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Define a function print total inches, with parameters num_feet and num_inches, that prints the total number of inches. Note: There are 12 ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers