Given: 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. Draw your Flowchart using the pseudocode below: 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
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Given:
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
Draw your Flowchart using the pseudocode below:
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
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images