Total Marks : 20View more random threads:
- CS615 Assignment No. 05 Spring 2011 idea Solution
- Assignment No. 3 Semester: Fall 2010 CS201: Introduction to...
- CS302: Digital Logic Design assignment no 4 idea solution...
- CS201 - Introduction to Programming All spring assignments...
- Operating System- CS604 Assignment # 3 fall 2010 date...
- CS402 assignment has been uploaded
- CS402 Theory of Automata Assignment No.5 Solution Fall...
- CS304 Object Oriented Programming assignmnet no 5 fall...
- CS201 Introduction to Programming Assignment No. 04...
- CS601 Data Communication assignment no 3 idea solution...
Due Date : 26-11-2012
Question 1: [20 Marks]
Write a C program that would draw the following shapes; rectangle, ellipse, circle and point in the following way as described below.
Rectangle:
Draw the rectangle as described in the figure below and the ellipse, circle and point should be drawn within the rectangle body.
Hint: Use the rectangle(x,y,a,b) function to draw the rectangle.
Sponsored Links
Ellipse:
Ellipse should be enclosed by the rectangle as described in the figure below.
Hint :Use the ellipse(x,y,startangle, endangle, semimajor, semiminor) function to draw the ellipse.
Circle:
Circle should be drawn with in the ellipse as described in the figure below.
Hint: Use the circle(x,y,radius) function to draw the circle.
Point:
Ellipse and circle should have common center and that center point should be displayed as a point.
Hint: Use the putpixel(x,y,colour) function to draw the point.
You can choose any colour for drawing rectangle, ellipse, circle and point; it can be of your own choice.
(Expected Output)
Note:
You can consult handouts of lecture 13 for help. You have to use Borlandc to run this program as
graphics.h is a borlnadc library. You can download borlandc setup from download section of cs602.
After installing Borlandc run BC.EXE.
Now Go to Options =>Linker =>Libraries
Press Alt + G
Press Alt +K
It will enable the graphics library. Now change following command in your program according to your installation.
initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
For example:
initgraph(&gdriver, &gmode, "c:\\BorlandC\\bgi");
There are currently 1 users browsing this thread. (0 members and 1 guests)