fork download
  1. //Ivy Whitney CSC 5 chp. 3, Q# 1
  2.  
  3. /************************************************************
  4. *
  5. *
  6. *CALCULATE A CAR'S GAS MILEAGE
  7. _____________________________________________________________
  8. *
  9. *
  10. * This program display the number of miles that may be driven
  11. * based on the amount of gas the user can hold in their car and
  12. * the number of miles that can be driven on a full tank.
  13. *
  14. * ==================Variables===============================
  15. *
  16. * INPUTs
  17. *
  18. * gasCapacity = Max amount of Gas the users car can hold
  19. * maxMiles = The number of miles that can be driven on a full tank
  20. *
  21. * OUTPUTs
  22. *
  23. * milesperGallon = The miles per gallon
  24. * ==========================================================
  25. * The MATH...
  26. *
  27. * milesperGallon = maxMiles / gasCapacity
  28. **************************************************************/
  29.  
  30. #include <iostream>
  31. #include <iomanip>
  32. #include <cmath>
  33.  
  34. using namespace std;
  35. int main() {
  36.  
  37. //variable time!
  38.  
  39. double gasCapacity;
  40. double maxMiles;
  41. double milesperGallon;
  42.  
  43. //User inputs
  44.  
  45. cout << "ENTER YOUR MAX FUEL CAPACITY BELOW.\n";
  46. cin >> gasCapacity ;
  47.  
  48.  
  49. }
  50.  
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
ENTER YOUR MAX FUEL CAPACITY BELOW.