troubleshooting Question

Need help getting this program running.

Avatar of boula
boula asked on
9 Comments1 Solution1406 ViewsLast Modified:
Define a class called Odometer that will be used to track fuel and mileage for an automotive vehicle.  The class should have member variables to track the miles driven and the fuel efficiency of the vehicle in miles per gallon.  Include a mutator function to reset the odometer to zero miles, a mutator function to set the fuel efficiency, a mutator function that accepts miles driven for a trip and adds it to the odometers total, and an accessor method that returns the number of gallons of gasoline that the vehicle has consumed since the odometer was last reset.  

Getting lots of errors and I cant figure it out...
#include <iostream>
using namespace std;
class odometer
      int gallons_consumed;
         int miles_tracker;
         double fuel_eff; 
         int getmiles
        void reset();
        void compute_fuel();
        void input_miles(int getmiles);
        void odometer::set_fuel_eff(double fuel_eff);
        double odometer::get_num_gallons();
                    miles_tracker = 0;
                    fuel_eff = 0;
void odometer::reset()
                      miles_tracker = 0;
void odometer::compute_fuel()
     fuel_eff = (miles_tracker/gallons_consumed);
void odometer::input_miles(int miles_driven)
     miles_tracker = miles_tracker + miles_driven;
void odometer::set_fuel_eff(double Fuel_eff)
     fuel_eff = Fuel_eff;
double odometer::get_num_gallons()
       return miles_tracker/fuel_eff;
int main()
    odometer simulator;
    int miles_driven
    int fueleff;
        cout<<"Enter the amount of miles driven :"<<endl;
        cin>> miles_driven;
        count << "Enter feul efficiency : "<<endl;
        cin >> fueleff;
        cout<<"Number of miles:"<<simulator.getmiles()<<end1
        cout<<"Number of Gallons consumed: "<<simulator.get_num_gallons()<<endl;

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros