Question: ) ( 1 0 points ) Gallon is a common volume unit. Sometimes, we need to convert gallon to other units such as Liter (

)(10 points)Gallon is a common volume unit. Sometimes, we need to convert gallon to
other units such as Liter (L), Cup, Fluid Ounce (fl oz).
Write a function that will receive a volume in Gallon as an input argument. The
function will convert the input to Liter, Cup, and Fluid Ounce. Return these three converted
values as output arguments of the function.
The conversion formulae are:
1 Gallon =3.7854 Liters
1 Gallon =128 Fluid Ounces
1 Cup =8 Fluid Ounces
If your function is named as VolUnits, it should work exactly as the followings:
>>[Lite, Cup, Foz]=VolUnits(1.0)
Lite =
3.7854
Cup =
16
Foz =
128
>>[L,C]=VolUnits(0.5)
L =
1.8927
C =
8
>>[L,C,O]=VolUnits(-1)
The input volume cannot be negative!
L =
-1
C =
-1
O =
-1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!