Advertisement
idsystems

CPP_Practica31 - Odometer

Jan 30th, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. // Program: odometer.cc
  2. // Author:  Yoan Pinzon
  3. // Date:    Agosto 30, 2006
  4.  
  5. #include <iostream>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.    float start, end, mon, tue, wed, thr, fri, milespergalon;
  12.    
  13.    cout << "Odometer" << endl;
  14.    cout << "========" << endl;
  15.  
  16.    cout << "start: "; cin >> start;
  17.    cout << "end: "; cin >> end;
  18.    cout << "Mon: "; cin >> mon;
  19.    cout << "Tue: "; cin >> tue;
  20.    cout << "Wed: "; cin >> wed;
  21.    cout << "Thr: "; cin >> thr;
  22.    cout << "Fri: "; cin >> fri;
  23.  
  24.    milespergalon = ( end - start ) / ( mon + tue + wed + thr + fri );
  25.  
  26.    cout << endl;
  27.  
  28.    cout << "Miles per galon= " << milespergalon;
  29.  
  30.    return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement