Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- class kolo{
- public:
- double rychlost = 0;
- void zrychli(int);
- void brzdi(int);
- };
- void kolo::zrychli(int x){
- rychlost = rychlost + x;
- }
- void kolo::brzdi(int x){
- rychlost = rychlost - x;
- }
- void main(){
- kolo kolo1;
- kolo1.zrychli(50);
- cout << kolo1.rychlost;
- cout << "\n";
- kolo1.brzdi(10);
- cout << kolo1.rychlost;
- cout << "\n";
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement