19.1k views
3 votes
In the metric system, fluid flow is measured in cubic meters per second (m3/s). a cubic foot per second (ft3/s) is equivalent to 0.028 m3/s. write a script titled flowrate that will prompt the user for flow in cubic meters per second and will print the equivalent flow rate in cubic feet per second. here is an example of running the script. your script must produce output in exactly the same format as this:

User Jens Kohl
by
5.6k points

1 Answer

4 votes

Here you go,


flowrate.m

cbps = input('Enter the flow in m^3/sec: ');

cfps = cbps ./ 0.028;

fprintf('A flow rate of %.3f meters per sec\\', cbps);

fprintf('is equivalent to %.3f feet per sec\\', cfps);

User Thomas Mondel
by
5.2k points