Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- using namespace std;
- class Circle
- {
- private:
- public:
- float radius;
- float x;
- float y;
- Circle(float Radius, float X, float Y) : radius(), x(), y()
- {
- radius = Radius;
- x = X;
- y =Y;
- }
- void getRadius(){ // ãåòòåð ðàäèóñà
- cout <<"Radius: "<<radius<<endl;
- }
- void getCoordinate(){
- cout << "X: "<<x<<";\n"<<"Y: "<<y<<";\n"<<endl;
- }
- float transX(float peremeshenie){
- return x + peremeshenie;
- }
- float transY(float peremeshenie){
- return y + peremeshenie;
- }
- };
- int main(int argc, char** argv) {
- Circle objCircle(10,12,12);
- objCircle.getRadius();
- objCircle.getCoordinate();
- objCircle.transX(2.3);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement