#include <stdio.h>
#include <math.h>
int main()
{
double x, y, z, r;
printf("MILEAGE REIMBURSEMENT CALCULATOR\n");
printf("Enter beginning odometer reading=>");
scanf("%lf", &x);
printf("Enter ending odometer reading=>");
scanf("%lf", &y);
z = y - x;
printf("You traveled z. At $61.11 per mile, your reimbursement is r", x, y, z, r);
scanf("%lf", &r);
return (0);
}
Ok, this is as far as I have gotten so far on problem 1 on the homework set. This produces:
MILEAGE REIMBURSEMENT CALCULATOR
Enter beginning odometer reading=>
Enter ending odometer reading=>
You traveled z miles. At $61.11 per mile, your reimbursement is r.
It should read that, just the z is supposed to be (ending odometer - beginning odometer) and the r is supposed to be (z * 61.11), but it will not compute anything
I am a completely baby programmer, just starting this semester in school lol and this is the first problem on our first assignment... even though teacher has taught us absolutely nothing yet... hmm...
Anyway can anyone help me get beginning odometer to allow you to enter a number to 1 decimal place, ending odometer enter a number to 1 decimal place, and final line subtracting the two and multiplying the difference?
Thanks soo much in advance! I am quite lost...
(P.S. I am pretty sure my scanf's are a little wonky