473,320 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Need Answer For my Question

3
Expand|Select|Wrap|Line Numbers
  1. /*The following program have the following output. write the necessary code to make it works?
  2. Code :*/
  3. //-----------------------------------------------------------------------------------------------------
  4. #include <iostream>
  5. using namespace std;
  6. class Point
  7. {
  8. private:
  9. int x;
  10. int y;
  11. public:
  12. Point(void);
  13. Point(int newx, int newy);
  14. Point( Point& from );
  15. ~Point(void);
  16. Point operator++() {inc(); return *this;}
  17. Point operator--() ;
  18. friend ostream& operator<<(ostream& out, Point p);
  19. void inc();
  20. void setX(int newX);
  21. void setY(int newY);
  22. inline int getX(){return x;}
  23. inline int getY(){return y;}
  24. };
  25. class Circle: public Point
  26. {
  27. float rad;
  28. public:
  29. Circle():Point(0,0), rad(0)
  30. {cout<<"Running Circle Default Contstructor"<< endl;}
  31. Circle(int a, int b, int c): Point(a, b), rad(c)
  32. {cout<<"Running Circle Normal Contstructor"<< endl;}
  33. Circle(Circle & from);
  34. Circle(Point & p);
  35. float getArea();
  36. float getRad();
  37. friend ostream& operator<<(ostream& out, Circle c);
  38. };
  39. main()
  40. {
  41. char a;
  42. {
  43. cout << "Write Your Name Here " << std::endl;
  44. Point p(5,7);
  45. Point r;
  46. Point q(p);
  47. ++p;
  48. cout<< q << p;
  49. r=q;
  50. --r;
  51. Circle c1(3, 5, 3), c2(p);
  52. cout << c1 << c2;
  53. }
  54. cin>>a;
  55. }
Write Your Name Here
Point construction using constructor
[5 ,7]
Point construction using default constructor
Point construction using Copy constructor
[5 ,7]
Point construction using Copy constructor
[6 ,8]
[6 ,8]Point destruction
Point construction using Copy constructor
[6 ,8]
Point construction using Copy constructor
[5 ,7]
Point: [5, 7]
Point: [6, 8]
[5 ,7]Point destruction
[6 ,8]Point destruction
Point construction using Copy constructor
[4 ,6]
[4 ,6]Point destruction
Point construction using constructor
[3 ,5]
Running Circle Normal Contstructor
Point construction using default constructor
Circle construction using Conversion constructor
Circle: [6 ,8], Radius=0
Point construction using default constructor
Circle construction using Copy constructor
Circle: [6 ,8], Radius=0
Point construction using default constructor
Circle construction using Copy constructor
Circle: [3 ,5], Radius=3
Circle: [3 ,5], Radius=3 Area=28.26
Circle: [6 ,8], Radius=0 Area=0
[3 ,5]Point destruction
[6 ,8]Point destruction
[6 ,8]Point destruction
[3 ,5]Point destruction
[5 ,7]Point destruction
[4 ,6]Point destruction
[6 ,8]Point destruction
May 10 '07 #1
3 1400
sicarie
4,677 Expert Mod 4TB
The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

Please read the Posting Guidelines and particularly the Coursework Posting Guidlines.

Then when you are ready post a new question in this thread.

MODERATOR
May 10 '07 #2
sicarie
4,677 Expert Mod 4TB
bayan1-

Please read the Posting Guidelines, and do not double-post. I have also PM'd you about your posts.
May 10 '07 #3
sicarie
4,677 Expert Mod 4TB
bayan1-

Please read the Posting Guidelines, and do not double-post. I have also PM'd you about your posts.
What error messages are you getting?
May 10 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Carolyn Gill | last post by:
I have already created an asp login/database for a learning/quiz section on a small site. There will be multiple quizzes through the site and what I need now would be help: tutorials or advice that...
9
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
4
by: Steve Klett | last post by:
(I posted this in ADO group, but I think this group will be better) Hi- I need to develop an FAQ section for our website. We would like to break up the FAQ by products, then categories with...
16
by: C++ Hell | last post by:
Hey everyone just designing a quiz for school and managed to write the code for the questions and answers thou i have to add scores and at the end an overall score does anyone have any idea what to...
10
by: gshy2014 | last post by:
Hi, all. IN Windows, TCHAR is translated to be wchar or char according to whether UNICODE is defined. Dose the complier handle the UNICODE(define or not define) according to the OS ? Many...
16
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client...
0
by: biganimal | last post by:
I have a program and I want the program to be able to save question/answers so the program actually gets smarter without getting amnesia everytime its started. Can anyone help??? # questor.py ...
27
by: comp.lang.tcl | last post by:
My TCL proc, XML_GET_ALL_ELEMENT_ATTRS, is supposed to convert an XML file into a TCL list as follows: attr1 {val1} attr2 {val2} ... attrN {valN} This is the TCL code that does this: set...
0
by: redlightpacket | last post by:
I need some C# code to read the stuff in a file. I want to display the question in a text box. I want the answers to display in a label. Like "LabelA, LableB, LabelC, LabelD". I also want it so I...
1
by: kvazar | last post by:
What I am trying to create is basically a page with a bunch of multiple choice questions. Basically just like a test page. I am providing the code lower. All the questions that need to show as a part...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.