subject

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. 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): Place your enum declaration and the prototype declaration in a file called hw04p5.h
Place your actual function implementation in a file called hw04p5.c
Create a main function in volumeDemo. c that prompts the user for one of the scales and a value to convert and outputs the result, of all four scales (Just use this to test your function, do not hand it in.)
Look online for a volume conversion table
The return value will be a flag indicating an error-level: 0 for no error, 1 for an error (negative values), and 2 for a NULL pointer error.
Define an enumerated type named Error to implement, this.
Enter a volume: 257.50
Enter scale (G, C, L, Q): L
Conversion:
257.50 Liters
68.02 Gallons
257500 Cubic Centimeters
272.10 Quarts
Please write the code using c programming.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 01:50, akornegay2
Write a program that uses a random number generator to generate a two digit positive integer and allows the user to perform one or more of the following operations: a. double the number. b. reverse the digits of the number. c. raise the number to the power of 2, 3, or 4. d. sum the digits of the number. e. if the number is a two-digit number, then raise the first digit to the power of the second digit. f. if the number is a three-digit number and the last digit is less than or equal to 4, then raise the first two digits to the power of the last digit. after performing an operation if the number is less than 10, add 10 to the number. also, after each operation determine if the number is prime. each successive operation should be performed on the number generated by the last operation. your program should not contain any global variables and each of these operations must be implemented by a separate function. also, your program should be menu driven. 7. (fraction calculator) write a program that
Answers: 1
image
Computers and Technology, 23.06.2019 06:10, erick7123
The head restraint should be adjusted so that it reaches a. the top of your ears b. the base of your skull c. the top of the head
Answers: 1
image
Computers and Technology, 23.06.2019 06:30, QueeeenUknown7437
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
image
Computers and Technology, 23.06.2019 11:00, abdulbasharee99
In the context of the box model, what is the difference between a margin and a padding? a. a padding lies outside a box border, while a margin lies inside it. b. a padding lies inside a box border, while a margin lies outside it. c. a padding can be adjusted independently, while a margin depends on the size of its box. d. a padding depends on the size of its box, while a margin can be adjusted independently.
Answers: 3
You know the right answer?
There are several different methods for measuring volume. For instance, you can measure volume in cm...

Questions in other subjects: