Question: Objective: user-defined functions. Void functions, and functions with input/output parameters. Instructions: Every problem should be written as a void function(void 01 (void)) that is called
Objective: user-defined functions. Void functions, and functions with input/output parameters. Instructions: Every problem should be written as a void function(void 01 (void)) that is called in the main function (01(). Submit the source code through Canvas. yourname Lab3.c is the file name. Use proper commenting at the beginning of your code with your name, lab number and date. (10 points deduction for not following any of the given formats) 1. Write a program that produces the following output: For that's a beautiful car! For that's a beautiful car! For that's a beautiful car! Which nobody can deny. Have the program use two user-defined functions; one that prints the "beautiful car" message once, and one that prints the final line once. (6 points) 2- Write a program that determines the gas mileage of a car based on the miles travelled and gallons of gas consumed. (9 points) a. First ask the user to enter the number of miles traveled and the number of gallons of gasoline consumed. b. Then calculate and display the miles-per-gallon value (MPG), showing one place to the right of the decimal. c. Next, using the fact that one gallon is about 3.785 liters and one mile is about 1.609 kilometers, convert the mile-per-gallon value to a liters-per-100-km value (L/100km), and display the result, showing two places to the right of the decimal. Note: The U.S. scheme measures the amount of fuel per distance, whereas the European scheme measures the distance per amount of fuel. d. Use symbolic constants (using #define) for the two conversion factors. The US government website should help in determining the actual MPGs for cars on the market: https://www.fueleconomy.gov/feg/findacar.shtml
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
