Created
April 5, 2018 14:36
-
-
Save draganczukp/5b3d43a1ea2315d4738e278e7764d160 to your computer and use it in GitHub Desktop.
throw.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Kurczak{ | |
private: | |
float cena; | |
float waga; | |
// int data produkcji; | |
// Datę pomijam bo zbędna | |
public: | |
Kurczak(float cena, float waga, int data){ | |
if(cena > 0) this->cena = cena; else throw new Exception("Zła cena"); | |
if(waga > 0 && waga < 10) this->waga = waga; else throw new Exception("Zła waga"); | |
// To samo dla daty | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment