#include <iostream.h>
#include <stdlib.h>
  main()
  {
  float gallon,mile,dev,dev1=0,ava=0;
  int   x,y=0;
         cout << "enter (-1) to end the program and any number to continue: ";
         cin  >>x ;
         cout << "---------------------------------------------------------\n";
         cout << "\n";
  while ( x!=-1){
         cout <<"Enter The gallons Used: ";
         cin  >> gallon;
         cout <<"Enter The Miles Driven: ";
         cin  >> mile;
         dev  = mile/gallon;
         dev1+= dev;
         y+=1;
         cout <<"The miles/gallons for this tank was: "<<dev<<endl;
         cout <<" \n";
         cout <<" \n";
         cout << "enter (-1) to end the program and any number to continue: ";
         cin  >>x ;
         cout << "---------------------------------------------------------\n";
         cout << "\n";
         }
         ava = dev1/y;
         cout << "Teh overall average miles/gallon was "<< ava<<endl;
  getchar();
  return 0;
  }

