Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class kruznica {
- private:
- double radius;
- const double PI = 3.14159;
- public:
- kruznica() {
- }
- kruznica(double _radius) {
- radius = _radius;
- }
- void set_radius(double _radius) {
- radius = _radius;
- }
- double get_radius() {
- return radius;
- }
- double get_PI() const {
- return PI;
- }
- double presmetaj_perimetar() const {
- return 2 * radius * PI;
- }
- };
- int main() {
- kruznica k(5.6);
- cout << k.get_PI() << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement