Exemple #1
0
int main()
{
	Tricycle wichita;
	wichita.setSpeed(0);
	wichita.pedal();
	wichita.pedal();
	wichita.pedal();
	wichita.brake();
	wichita.brake();
	wichita.brake();
	wichita.brake();
	return 0;
}
Exemple #2
0
int main()
{
    std::cout << "Creating trike named wichita ...";
    Tricycle wichita;
    wichita.pedal();
    std::cout << "Creating trike named dallas ...\n";
    Tricycle dallas(wichita);
    std::cout << "wichita's speed: " << wichita.getSpeed() << "\n";
    std::cout << "dallas's speed: " << dallas.getSpeed() << "\n";
    std::cout << "setting wichita to 10 ...\n";
    wichita.setSpeed(10);
    std::cout << "wichita's speed: " << wichita.getSpeed() << "\n";
    std::cout << "dallas's speed: " << dallas.getSpeed() << "\n";
    return 0;
}