943,675 Members | Top Members by Rank

Ad:
Mar 19th, 2009
0

shapes in C++

Expand Post »
Hi all,

i m new to the programming storie,

can any one please help me? i want to write a program that allows the user to input the diamention (e.g heit, weight) used to draw the object shape. the program should then compute the area and display the shape based on the inputed diamention.

some how i must use header files.

here is what i have tried so far:

#include <graphics.h>
#include<iostream.h>
#include<stdlib.h>
#include<conio.h>

#include "MyHeader.h";

void main ()
{

int gd=DETECT, gm;
initgraph (&gd, &gm, "c:\\tc\\bgi");
int err=graphresult();
if (err !=grOk)

{
cout<<"graphics not initialised";
return;
}

fillsettingstype f;
getfillsettings (&f);

cout<<"Which shape are you working with"<<endl;
cin>>'1' || '2' || '3';

if (cin == 1)
{


circle();
}

return 0;

}

void circle ( int x, int y, int z)

{
int color, area;
setcolor(LIGHTGREEN);
cout<<"enter your circle cordinates:";
cin>> x, y, z;
getch();
closegraph();
}
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
naveuye is offline Offline
1 posts
since Mar 2009
Mar 20th, 2009
0

Re: shapes in C++

welcome

nyc code.
Reputation Points: 102
Solved Threads: 46
Nearly a Posting Virtuoso
sittas87 is offline Offline
1,312 posts
since Apr 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Community Introductions Forum Timeline: Greetings from Sweden
Next Thread in Community Introductions Forum Timeline: hi





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC