Ask Question

2. Feet to Inches One foot equals 12 inches. Design a function named feetToInches that accepts a number of feet as an argument, and returns the number of inches in that many feet. Use the function in a program that prompts the user to enter a number of feet and then displays the number of inches in that many feet.

+5
Answers (1)
  1. 18 June, 08:49
    0
    See the below the answer written in Matlab

    Explanation:

    function inches=feetToInches (feet)

    prompt='enter the value of feet in digits';

    feet=input (prompt) % ask for the value in feet that needs to be converted to inches

    inches = feet*12; % converts feet to inches

    x=['the value in inches is: ', num2str (inches) ];

    disp (x) %display the result of the convertion

    end
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “2. Feet to Inches One foot equals 12 inches. Design a function named feetToInches that accepts a number of feet as an argument, and returns ...” 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