Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "Car.h"
- #include "Car.cpp"
- #include <stdio.h>
- #include <string>
- #include <iostream>
- using namespace std;
- int main(){
- Car dealer;// Creates a new Car object
- int yearModel;// Local variables for model year
- int speed;// Local variables for speed
- string make;// Names are kept the same to avoid confusion
- // Calls the accelerate function 5 times and displays the results after each iteration
- for (int i = 0; i < 5; ++i){
- dealer.accelerate(speed);
- cout << "The current speed is: " << dealer.getSpeed() << endl;
- }
- cout << "We are now braking the car" << endl;
- // Calls the brake function 5 times and displays the results after each iteration
- for (int i = 0; i < 5; ++i){
- dealer.brake(speed);
- cout << "The current speed is: " << dealer.getSpeed() << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement