Question: C language 2. There are several different methods for measuring volume. For instance, you can measure volume in cm3, liters, quarts, and gallons. You could
C language


2. There are several different methods for measuring volume. For instance, you can measure volume in cm3, liters, quarts, and gallons. You could write several functions to compute back and forth between these four scales. However, for this exercise, you will write a single function to convert a single value from any of the four scales to any of the other four scales. Your main function will prompt the user to input two values: a real number to that represents volume and a character that represents the scale (for example, to represent Liter, the user will enter 'L'). Then you will use the following function to convert the volume to other three scales. To support this, you will need to define an enumerated type called Volume that enumerates the following four scales: CM, LITER, QUART, GALLON. You will then use this enumerated type and implement the following function: int convert Volume(double *cm, double *liter, double *quart, double *gallon, Volume scale); me(double tem, double "liter, double "quart, double gallon, Volume . Place your enum declaration and the prototype declaration in a file called Mea- sureVol.h
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
