Convert coordinate - c++ program, C/C++ Programming

Assignment Help:

Convert coordinate:

class rect{

                private :

                float  x,y;

 

                public :

                void  input()

                {

                cout <<"enter rect coords\n";

                cin >> x>> y>>"\n";

                }

                void output()

                {

                                cout << x<<"\n" << y;

                }

                rect ()//dummy consructor

                {

                }

                rect (float a,float b)//constructor

                {

                x=a;

                y=b;

                }

                }; //end of class

 

                class polar {

                private :

                float r,q;

 

                public :

                void input()

                {

                cout <<"enter polar coords\n";

                cin>>r>>q;

 

                }

                void output()

                {

                cout << r<

                }

                operator rect();

                };//end of class

 

       polar :: operator rect()

                                {

                                float a=r*cos(22*q/(7*180));

                                float b=r*sin(22*q/(7*180));

                                return rect(a,b);//calling constructor inbuild that it will

                                                                 //return rect type

                                }

    void main()

    {

 

    rect a;

    polar p;

    clrscr();

    p.input();

    a=p;

    a.output();

    getch();

    }


Related Discussions:- Convert coordinate - c++ program

Programming, what is the first thing I need to know about Programming?

what is the first thing I need to know about Programming?

Application to maintain soccer team information, Write a C program "team.c"...

Write a C program "team.c" that maintains information for a soccer team. The program will allow you to add and delete players from your team, to search your team for players by nam

Calculation of mortgage interest rates, 1. When developing this project in ...

1. When developing this project in a Win32 Console Applications that includes the precompiled headers, enter in the Name: box, PRJ2[Your Full Last Name][Your First Initial] with no

Convert afl amibroker to dll, Project Description: I need to convert AFL...

Project Description: I need to convert AFL code of Amibroker to DLL plugin to hide original formula, and also to protect the DLL and making it hardware locked. I need to wrap th

Define the classification of operators in c language, Define the Classifica...

Define the Classification of Operators in C Language? Depending on the function performed the operator can be classified as 1. Arithmetic Operator 2. Logical Operator 3. Inc

Menus, create a shopping cart in c++

create a shopping cart in c++

Rules of function, Rules of function: Inline function created witho...

Rules of function: Inline function created without prototype it reduces the memory and it is used only for small function. Inline function cannot have recursion, static var

Write a program that calculates circumference and area, Write a program cal...

Write a program called A1Q3, that reads it the radius of a circle as an integer and prints the circle's diameter, circumference and area.  Use a constant value for pi.  Do all calc

Stone Game - Remove Last, #include int main() { int T; ...

#include int main() { int T; int N; int i; scanf("%d",&T)

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd