Question: 2. There are several different methods for measuring volume. For instance, you can measure volume in cm, liters, quarts, and gallons You could write several
2. There are several different methods for measuring volume. For instance, you can measure volume in cm, 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. this enumerated type and implement the following function int convert Volume(double *em, double "liter, double "quart, double *gallon, Volume scale); . 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
