Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- class forma_geo
- {
- protected:
- int raza;
- public:
- void set_raza(int r)
- {
- raza = r;
- }
- };
- class cost
- {
- public:
- float calcul(float aria)
- {
- return (aria*350);
- }
- };
- class cerc: public forma_geo, public cost
- {
- public:
- float get_aria()
- {
- return(raza*raza* 3.14);
- }
- };
- int main ()
- { cerc c1;
- int r;
- cout <<"Introduce ti raza: "; cin >> r;
- c1.set_raza(r);
- cout<<"\nAria formei geometrice este "<<c1.get_aria()<<endl;
- cout<<"Costul total este "<<c1.calcul(c1.get_aria())<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement