Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Schwein
- {
- private:
- int groesse;
- float gewicht;
- int saettigung;
- public:
- void wachsen(void);
- //void init(void);
- void ausgabe(void);
- Schwein();
- };
- void Schwein::wachsen(void)
- {
- groesse++;
- }
- /*
- void Schwein::init(void)
- {
- groesse = 20;
- gewicht = 0.5;
- saettigung = 30;
- }
- */
- void Schwein::ausgabe(void)
- {
- cout << "Das Schwein ist " << groesse << " cm gross" << endl;
- cout << "Das Schwein ist " << gewicht << " kg schwer" << endl;
- cout << "Das Schwein ist " << saettigung << " % gesaettigt" << endl;
- }
- Schwein::Schwein()
- {
- }
- int main()
- {
- Schwein Hugo;
- Hugo.init();
- Hugo.ausgabe();
- Hugo.wachsen();
- getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement