Ask the user to enter his height in ft and inches Then conve
Ask the user to enter his height in ft and inches. Then convert the height into meters and write the output to a file. Write the output into a file named Lab2Hwk2prob3Output.txt. You MUST write the steps involved in the process or draw a flowchart
(I want this answer in MATLAP program)
Solution
% Height conversion from FPS to SI unit
% User Input (Height in ft and inch unit)
% Enter height e.g. for 5ft 10in height enter [5 10]
h_fps = input(\'Please enter your height in ft and inch unit in an array: \');
% first value is in ft
h_ft = h_fps(1);
% second value is in in
h_in = h_fps(2);
% do the conersion from ft to metre and in to metre
h_SI = h_ft*0.3048 + h_in*0.0254;
fprintf(\'The height in metre is: %d\ \',h_SI)
OUTPUT:
Please enter your height in ft and inch unit in an array: [5 6]
The height in metre is: 1.676400e+00
