473,322 Members | 1,314 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,322 software developers and data experts.

Please Help Me With Graph Task in C++

Would u help me with this task, I am new in C++ programming, this codes have alot of errors, I have never work with graphs before, I am using Borlard C++ Ver 5.02. I was told u can not run a graph task using text editor. If that is the case how can I run this. I have only 7Days to handin this Task.

(a) Explain what process are being carried out by each method.
(b)Test this code on your system and report the outcome of your tests in a systematic manner. You need to provide a rationale for every test undertaken.
(c)Write a critical review of a given code and identify any strengths or weakness that may be present.

The Message Error I am getting when running this programme is : GRAPHICS.H(20.52); Error directive:BGI graphics not supported under windows.
Expand|Select|Wrap|Line Numbers
  1. #include <graphics.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. #include <math.h>
  5. #include <conio.h>
  6. const int X0=320;
  7. const int Y0=240;
  8. const float PI=3.14159;
  9. const int NUME=30;
  10. const DENOM=100;
  11. const int NUMBER=7;
  12. const float RAD=3.0;
  13. const float DELTA=0.1;
  14. const int SEGS=60;
  15. const int REDUX=3;
  16. const int MIN=1;
  17. class cluster
  18. {
  19. Public:
  20. void display(int size, int x, int y);
  21. };
  22. class tendril
  23. |
  24. Public:
  25. void display (int size, float theta, int x, int y);
  26. };
  27. void cluster::display(int size, int x,int y)
  28. {
  29. if (kbhit())
  30. exit(0);
  31. for(int i=0;i<NUMBER;i++)
  32. {
  33. float theta i*2*PI/NUMBER;
  34. moveto(x,y);
  35. tendril t;
  36. t.display(size,theta, x,y);
  37. }
  38. }
  39. void tendril::display(int size, float theta, int x,int y)
  40. {
  41. for(int j=0;j<size;j++)
  42. {
  43. int chng=(random(DENOM)<NUME)?-1:1);
  44. theta=thetha+chng*DELTHETA;
  45. x=x+RAD*sin(theta);
  46. y=y+RAD*cos(theta);
  47. if(size<4)setcolor(RED);
  48. else if(size<13)setcolor(GREEN);
  49. else if(size<40)setcolor(LIGHTGREEN);
  50. else setcolor(YELLOW);
  51. lineto(x,y);
  52. }
  53. if(size>MIN)
  54. {
  55. cluster c;
  56. int newsize=size/REDUX;
  57. c.display(newsize,x,y);
  58. }
  59. }
  60. void main ()
  61. {
  62. int driver, mode;
  63. driver=VGA;
  64. mode=VGAHI;
  65. initgraph(&driver,&mode,"\\bc5\\bgi");
  66. randomize();
  67. int x=X0, y=Y0;
  68. int size=SEGS;
  69. cluster c;
  70. c.display(size, x,y);
  71. getch();
  72. closegraph();
Would u help me with this task, I am new in C++ programming, this codes have alot of errors, I have never work with graphs before, I am using Borlard C++ Ver 5.02. I was told u can not run a graph task using text editor. If that is the case how can I run this. I have only 7Days to handin this Task.
(a) Explain what process are being carried out by each method.
(b)Test this code on your system and report the outcome of your tests in a systematic manner. You need to provide a rationale for every test undertaken.
(c)Write a critical review of a given code and identify any strengths or weakness that may be present.
Apr 26 '07 #1
2 2113
sicarie
4,677 Expert Mod 4TB
Would u help me with this task, I am new in C++ programming, this codes have alot of errors, I have never work with graphs before, I am using Borlard C++ Ver 5.02. I was told u can not run a graph task using text editor. If that is the case how can I run this. I have only 7Days to handin this Task.

(a) Explain what process are being carried out by each method.
(b)Test this code on your system and report the outcome of your tests in a systematic manner. You need to provide a rationale for every test undertaken.
(c)Write a critical review of a given code and identify any strengths or weakness that may be present.

The Message Error I am getting when running this programme is : GRAPHICS.H(20.52); Error directive:BGI graphics not supported under windows.
Expand|Select|Wrap|Line Numbers
  1. #include <graphics.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. #include <math.h>
  5. #include <conio.h>
  6. const int X0=320;
  7. const int Y0=240;
  8. const float PI=3.14159;
  9. const int NUME=30;
  10. const DENOM=100;
  11. const int NUMBER=7;
  12. const float RAD=3.0;
  13. const float DELTA=0.1;
  14. const int SEGS=60;
  15. const int REDUX=3;
  16. const int MIN=1;
  17. class cluster
  18. {
  19. Public:
  20. void display(int size, int x, int y);
  21. };
  22. class tendril
  23. |
  24. Public:
  25. void display (int size, float theta, int x, int y);
  26. };
  27. void cluster::display(int size, int x,int y)
  28. {
  29. if (kbhit())
  30. exit(0);
  31. for(int i=0;i<NUMBER;i++)
  32. {
  33. float theta i*2*PI/NUMBER;
  34. moveto(x,y);
  35. tendril t;
  36. t.display(size,theta, x,y);
  37. }
  38. }
  39. void tendril::display(int size, float theta, int x,int y)
  40. {
  41. for(int j=0;j<size;j++)
  42. {
  43. int chng=(random(DENOM)<NUME)?-1:1);
  44. theta=thetha+chng*DELTHETA;
  45. x=x+RAD*sin(theta);
  46. y=y+RAD*cos(theta);
  47. if(size<4)setcolor(RED);
  48. else if(size<13)setcolor(GREEN);
  49. else if(size<40)setcolor(LIGHTGREEN);
  50. else setcolor(YELLOW);
  51. lineto(x,y);
  52. }
  53. if(size>MIN)
  54. {
  55. cluster c;
  56. int newsize=size/REDUX;
  57. c.display(newsize,x,y);
  58. }
  59. }
  60. void main ()
  61. {
  62. int driver, mode;
  63. driver=VGA;
  64. mode=VGAHI;
  65. initgraph(&driver,&mode,"\\bc5\\bgi");
  66. randomize();
  67. int x=X0, y=Y0;
  68. int size=SEGS;
  69. cluster c;
  70. c.display(size, x,y);
  71. getch();
  72. closegraph();
Would u help me with this task, I am new in C++ programming, this codes have alot of errors, I have never work with graphs before, I am using Borlard C++ Ver 5.02. I was told u can not run a graph task using text editor. If that is the case how can I run this. I have only 7Days to handin this Task.
(a) Explain what process are being carried out by each method.
(b)Test this code on your system and report the outcome of your tests in a systematic manner. You need to provide a rationale for every test undertaken.
(c)Write a critical review of a given code and identify any strengths or weakness that may be present.
Well, let's start with A. What do you think is being done by these functions?
Apr 27 '07 #2
Well, let's start with A. What do you think is being done by these functions?
Thank u sicarie, I have cleared the errors, The programme is running Now, so I will score 40 marks.

Regards
Zak
Apr 28 '07 #3

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

Similar topics

9
by: Lilith | last post by:
Is there a python module somewhere (been searching today, no luck) which has efficiently coded various graph-handling routines, such as finding the shortest path through a graph, or the set of all...
1
by: SallyBenjamin | last post by:
Hello.. Can anyone help me with this coding. Basically, it needs to have add node, remove node, add edges , remove edges and display the graph But.I have only succedded to add node, add and...
2
by: Christian Christmann | last post by:
Hi, I need to write a graph which provides at least the following functions: 1) stores nodes and edges (both store further information which can be of any type) 2) manipulations on nodes and...
0
by: Joe | last post by:
Dear Friends, I want dynamically create the Graph from C# application. The graph would be timeInterval VS percentage. timeInterval percentage Recordno 8/2/2003...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
7
by: vbnetdev | last post by:
My boss wants this done in a day. I would be happy with a week! Anyway, I have a dataset filled with data and need to populate an MS word chart with it when writing a report. Any tutorials or...
0
by: jatininfo02 | last post by:
Hi Friend i am working on a task where i have to display XML Stream data on a graph for a window application, data is coming in the form of xmstream continuously and we have to plot a graph of...
2
by: sriniwas | last post by:
Hi Frnd's, m using prefuse visulation,it's have one display class and this class have one saveImage(outPutStream, String jpg,double size);. now graph is converting ia jpg image properly.now my...
8
thatos
by: thatos | last post by:
I am trying to write an program which performs a breath first search on a graph and returns a tree. class Alist{ int x; Alist next; public Alist (){ } public Alist(int x){ this.x =...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.