All pastes #1067644 Raw Edit

Unnamed

public text v1 · immutable
#1067644 ·published 2008-07-10 05:19 UTC
rendered paste body
#include <iostream>
using namespace std;
class car {
      public: char make[20];
      int year, speed;
      car( int year, char make[20]){}
      int alterspeed(int direction){speed += direction*5;}};
int main(){
    int year;
    char make[20];
    cout<<"Input the Year and the Make, respectively.\n";
    cin>>year>>make;
    car Car(year,make);
    for (int x=0; x<10; x++){
        cout<<"The speed of the car is"<< Car.speed <<"\n";
        if(x<5)Car.alterspeed(1);
		else Car.alterspeed(-1);}}