1
#ifndef CAR_H
#define CAR_H
class Car
{
    private:
        int year_;
        std::string make_;
        int speed_;
    public:
        explicit Car(){}
        explicit Car(int year, std::string make):year_(year),make_(make){ speed_= 0;}
        int getYear()
        {
            return year_;
        }
        std::string getMake()
        {
            return make_;
        }
        int getSpeed()
        {
            return speed_;
        }
        void Accelerate()
        {
            speed_ +=5;
        }
        void Brake()
        {
            speed_ -= 5;
        }
};

#endif

Car.cpp

#include <iostream>

#include "Car.h"

using namespace std;
int main()
{
    Car c(2001,"toyota") ;

    for(int i=0 ; i < 5; ++i)
    {
    c.Accelerate();
    cout << c.getSpeed() << endl;
    }
    for(int i=0 ; i < 5; ++i)
    {
    c.Brake();
    cout << c.getSpeed() << endl;
    } 

}
Votes + Comments
please tell me whether both of the programs are separate or this is one pograme