<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CS602 Assignment 1 Solution and Discussion]]></title><description><![CDATA[<p dir="auto">Re: <a href="/topic/1850/cs602-assignment-1-solution-and-discussion">CS602 Assignment 1 Solution and Discussion</a></p>
<pre><code>Assignment No. 01
</code></pre>
<p dir="auto">Semester: Fall 2020<br />
CS602: Computer Graphics<br />
Total Marks: 20</p>
<p dir="auto">Due Date: 4th Dec, 2020</p>
<p dir="auto">Objective<br />
The objective of this assignment is to;<br />
	Learn and practice basic concepts of computer graphics like pixels, lines, circles and rectangles, texts etc using Dev-C++. (You can download Dev-C++ setup from LMS)<br />
	Learn to fill the shapes and patterns by using flood fill algorithm.<br />
Instructions:<br />
You have to do the following steps first in order to perform the task.</p>
<ol>
<li>Install Dev-C++ from your LMS.</li>
<li>Download from LMS and Read out the file “Add graphics in Dev cpp” thoroughly and follow the instructions in the file properly provided to you on your LMS.<br />
Please read the following instructions carefully before submitting assignment:</li>
<li>You should consult the recommended books, PowerPoint slides, Handouts, and video lectures to clarify your concepts.</li>
<li>You can take any help from your provided labs.</li>
<li>It should be clear that your assignment will not get any credit if:<br />
•	The assignment is submitted after due date.<br />
•	The assignment is copied from Internet or from any other student.<br />
•	The submitted assignment does not open or file is corrupt.<br />
Submission<br />
You are required to submit your solution through LMS in word file.<br />
For any query about the assignment, contact at <a href="mailto:cs602@vu.edu.pk" target="_blank" rel="noopener noreferrer nofollow ugc">cs602@vu.edu.pk</a></li>
</ol>
<p dir="auto">TASKS                                                                                                                                     Marks=20</p>
<p dir="auto">Question 1) Write a program in Dev C++ to draw a circle. Also, use the flood fill algorithm to fill the circle with different lines of red color.  The output of your program should like the below image:<br />
<img src="https://i.imgur.com/UwqGgjz.png" alt="9162d193-0de3-46fc-a3c3-e1d6bf09d5c8-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Question 2) Write a program in Dev C++ to fill a rectangle shape using the flood fill algorithm, In which you are required to write a function as floodFill with four parameters as (x,y, pcolor, ncolor) the repeat it until the rectangle is completely filled,</p>
]]></description><link>https://community.secnto.com//topic/2179/cs602-assignment-1-solution-and-discussion</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 23:51:51 GMT</lastBuildDate><atom:link href="https://community.secnto.com//topic/2179.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 09 Feb 2021 06:59:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CS602 Assignment 1 Solution and Discussion on Tue, 09 Feb 2021 07:00:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/zaasmi" aria-label="Profile: zaasmi">@<bdi>zaasmi</bdi></a> said in <a href="/post/6455">CS602 Assignment 1 Solution and Discussion</a>:</p>
<blockquote>
<p dir="auto">Question 1) Write a program in Dev C++ to draw a circle. Also, use the flood fill algorithm to fill the circle with different lines of red color.  The output of your program should like the below image:</p>
</blockquote>
<p dir="auto"><strong>Solution:</strong></p>
<pre><code>// C Implementation for setfillstyle 
// and floodfill function 
#include &lt;graphics.h&gt; 

// driver code 
int main() 
{ 
	// gm is Graphics mode which is 
	// a computer display mode that 
	// generates image using pixels. 
	// DETECT is a macro defined in 
	// "graphics.h" header file 
	int gd = DETECT, gm; 
	
	// initgraph initializes the 
	// graphics system by loading 
	// a graphics driver from disk 
	initgraph(&amp;gd, &amp;gm, " "); 

	// center and radius of circle 
	int x_circle = 250; 
	int y_circle = 250; 
	int radius=100; 
	
	// setting border color 
	int border_color = WHITE; 
	
	
	// set color and pattern 
	setfillstyle(HATCH_FILL,RED); 
	
	// x and y is a position and 
	// radius is for radius of circle 
	circle(x_circle,y_circle,radius); 
	
	// fill the color at location 
	// (x, y) with in border color 
	floodfill(x_circle,y_circle,border_color); 

	getch(); 
	
	// closegraph function closes the 
	// graphics mode and deallocates 
	// all memory allocated by 
	// graphics system 
	closegraph(); 
	
	return 0; 
}

</code></pre>
]]></description><link>https://community.secnto.com//post/6456</link><guid isPermaLink="true">https://community.secnto.com//post/6456</guid><dc:creator><![CDATA[zaasmi]]></dc:creator><pubDate>Tue, 09 Feb 2021 07:00:55 GMT</pubDate></item></channel></rss>