I am trying to get it to look something like this if someone could give me a hint or a little help (for school) i can't get the calculations to work ( i can't get it to read 22.421875.

Enter the gallons used (-1 to end) : 12.8
Enter the miles driven: 287
The miles / gallon for this tank was 22.421875