#include <iostream>
#include <iomanip>
#include <math.h>
#include <string>
#include <fstream>
#include <sstream>
#include <vector>
using namespace std;
/* This is a simple example of a class that has data and functions */
class car {
public:
double speed;
double milage;
void start() {
speed = 0;
cout <<"Vroom"<<endl;
}
void accelerate(double how_much) {
speed += how_much;
}
};
int main()
{
car my_car;
my_car.start();
my_car.accelerate(5);
cout << my_car.speed<<endl;
my_car.accelerate(5);
cout << my_car.speed<<endl;
system("pause");
}
Back to top