Write a computer program as a Win32 console application in C to calculate mileage reimbursement for a salesperson at a rate of $0.50 pet mile. Your program shall take two numbers as inputs, and then display the mileage and reimbursement amount. The name of your source file shall be p1 .c and that of your executable program shall be p1.exc. You program shall receive information from the user as the user types in two numbers to be processed. Y our program shall NOT print information to the screen except a. Your one-time output program heading and prompt shall be EE233 Spring 2017. P1: MILEAGE REIMBURSEMENT CALCULATOR Enter beginning odometer reading => 13503.2 Enter ending odometer reading => 13810.6 (The underlined numbers .0 the right, simulate user-entered numbers that are not part of the prompt itself) Your program shall accept two floating point numbers on two separate lines for a given calculation. The two numbers shall be of double data type. For a given pair of numbers, the printout shall be of the form You travelled 307.4 miles. At $0.50 per mile, your reimbursement is $153.70. (The numbers above are examples only. Replace them with what you calculate and be sure to follow each line of output with a newline.) Your output should be formatted exactly as the examples above.
// C code
#include <stdio.h>
#include <string.h>
int main()
{
double start_reading, end_reading;
double reimburstment_rate = 0.5;
double final_reimburstment;
printf(\"Enter beginning odometer reading => \");
scanf(\"%lf\",&start_reading);
printf(\"Enter ending odometer reading => \");
scanf(\"%lf\",&end_reading);
final_reimburstment = (end_reading- start_reading) * reimburstment_rate;
printf(\"\ You travelled %0.1lf miles. At $%0.2lf per mile,\ your reimburstment is $%0.2lf.\ \",(end_reading- start_reading),reimburstment_rate,final_reimburstment);
return 0;
}
/*
output:
Enter beginning odometer reading => 13503.2
Enter ending odometer reading => 13810.6
You travelled 307.4 miles. At $0.50 per mile,
your reimburstment is $153.70.
*/