Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS602-Computer Graphics Assignment No. 02 Fall 2012
#1
Total Marks : 20
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.

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.
[Image: untitluwu.bmp]


(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");
For Assignment Solution Call Now 0332-8775841 | VU Assignments Solutions | VU Quizzes | VU GDPS | VU Projects | VU Past Papers
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  CS301 Assignment # 4 Due Date: 02-Feb-2016 Vuhelper 0 2,319 02-03-2016, 05:38 PM
Last Post: Vuhelper
  CS703 – Advanced Operating Systems Assignment No.3 solution January 2016 Vuhelper 0 5,904 01-23-2016, 09:58 PM
Last Post: Vuhelper
  CS601 Data Communication Assignment No. 03 Solution 23rd January 2016 Vuhelper 1 1,924 01-23-2016, 06:09 PM
Last Post: Vuhelper
  CS403 Assignment No. 03 Solution 23rd January 2016 Vuhelper 2 1,159 01-23-2016, 03:18 PM
Last Post: Vuhelper
  CS506 Web Design and Development Assignment no 3 Solution 3rd January 2016 Vuhelper 0 2,237 01-23-2016, 03:16 PM
Last Post: Vuhelper
  CS724 Software Process Improvement Assignment No 01 Solution 20th January 2016 Vuhelper 0 1,962 01-20-2016, 06:26 PM
Last Post: Vuhelper
  CS711 Software Design Assignment No 01 Solution Due Date Feb 12, 2016 Vuhelper 0 1,658 01-20-2016, 06:24 PM
Last Post: Vuhelper
  CS709 Formal Methods for Software Engineering Assignment No 01 Solution January 2016 Vuhelper 0 1,792 01-20-2016, 06:22 PM
Last Post: Vuhelper
  cs703 assignment no 3 Solution 20th January 2016 Vuhelper 0 1,695 01-20-2016, 06:20 PM
Last Post: Vuhelper
  CS704 Assignment No. 01 Solution January 2016 Vuhelper 0 4,793 01-20-2016, 06:19 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)