tan x Graph

Description:           This program creates a graph for tan x.   Primary Inputs:    —— Primary Output:    tan x Graph Platform Used:      Turbo C++ version 3.0, Borland International Inc.   #include #include #include #include void main() { int gd=DETECT,gm; int x,y; initgraph(&gd,&gm,"c:\\tc\\bgi"); for(x=0;x

Sine Curve

Description:           This program creates a sine curve   Primary Inputs:    —– Primary Output:    A sine curve for prespecifed parameters. Platform Used:      Turbo C++ version 3.0, Borland International Inc.   /*This program generates the sine curve for prespecified parameters. */ #include #include #include #include #include void main() { int gdriver=DETECT,gmode,i; float x=0; clrscr(); initgraph(&gdriver,&gmode,"c:\\tc\\bgi"); for(i=0;i

Rolling Circle

Description:           This program creates a graphic in which one circle (small) is rolling on the surface of other circle(large).   Primary Inputs:    —– Primary Output:    small circle rolling on the circumference of large circle Platform Used:      Turbo C++ version 3.0, Borland International Inc.   #include #include #include #include #include #include #define ROUND(a) (int)(a+0.5) void main() { int i,ang; ...

Parabola

Description:           This program creates a graphic describing the path of parabola.   Primary Inputs:    (x,y) coordinates and value of a Primary Output:    parabola Platform Used:      Turbo C++ version 3.0, Borland International Inc.   #include #include #include #include void main() { float x, y, a; int gdriver=DETECT; int gmode,i; initgraph(&gdriver, &gmode, "c:\\tc\\bgi"); printf("Enter the coordinates x and y:"); scanf("%f ...

Fan

Description:           This program creates a graphic for fan motion.   Primary Inputs:    —– Primary Output:    fan in motion Platform Used:      Turbo C++ version 3.0, Borland International Inc.   #include #include #include #include #include void main() { int gdriver=DETECT; int gmode; float x,y,u,g,h,x1,y1,x2,y2,r,r1,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8,x9,y9; initgraph(&gdriver, &gmode,"c:\\tc\\bgi"); x=getmaxx()/2; y=getmaxy()/2; r=20; r1=200; for(h=0;h

DDA Line

Description:              This program implements the DDA algorithm of line drawing.   Primary Input:        Two end point coordinates of the line. Primary Output:       A line drawn according to the given end points. Platform Used:         Turbo C++ version 3.0, Borland International Inc.   /*This program generates a line according to DDA algorithm for given end points. */ #include #include #include #define ROUND(a) ...

Car

Description:           This program creates graphic for moving car. Primary Inputs:    ——- Primary Output:    moving car Platform Used:      Turbo C++ version 3.0, Borland International Inc.   #include #include #include #include void main() { int gdriver = DETECT; int gmode; int i; initgraph(&gdriver,&gmode,"c:\\tc\\bgi"); line(0,400,640,400); for(i=0;i

net.make

Make file for the Graph Simulator   /*net.make*/ net.out : net.o       g++ -o net.out net.o net.o : net.cpp help.h       g++ -c net.cpp clean :       rm *.o net.out

net.cpp

Description:          This program is Menu driven program for Creating/deleting inodes and connection in the Graphs.   Platform Used:      g++ (GNU C++, a freely redistributable C++ compiler).   /*net.cpp*/ #include #include "help.h" using namespace std; int main() { graph g; int x,choice,l, y,m,n,d,c;; static int count; do { choice=g.displaymenu(); switch(choice) { case 1:x=++count; g.adb(g.p,x); cout

help.h

  This is a sub page help code for Graph Simulator /*help.h*/ include using namespace std; struct node { int name; int cost; struct node *connect; struct node *next; //struct node *back; }; class graph { public: node* p; graph() { p = NULL; } int displaymenu(); void adb(struct node *q,int x); void display(struct node ...