We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

CS602 Computer Graphics Assignment No 01 Fall 2019 Solution & Discussion

CS602 Computer Graphics Assignment 1 Solution Fall 2019


 

Submission 
You are required to submit your solution through LMS in zip format containing following files.
Your Project in zipped form containing both .cpp and .exe file.

The word document (.doc/docx) or any other file format containing code will not be considered.
If the code files are missing in zip folder, your assignment will be awarded as zero.
Note: No assignment will be accepted after the due date through email in any case (load shedding, server down, internet malfunctioning etc.). 
It is recommended to upload solution file at least two days before its closing date.

For any query about the assignment, contact at cs602@vu.edu.pk

Question#1                                                 TASK Marks=20


A graphic designing company ABC needs your services to write a code for a particular design consisting of lines, circles and rectangles as given below. The design will be used for greeting cards printing, mug art printing and t-shirts printing in future. Following design is selected for this purpose:

 

Now you have to write a code for generating the above design using “graphics.h”. Your actual Student-ID should be displayed at the top left corner of the screen

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 852

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Replies to This Discussion

Please Discuss here about this assignment.Thanks

Our main purpose here discussion not just Solution

Discussed & be touched with this discussion. After discussion a perfect solution will come in a result at the end.

 

 

P.S:    Please always try to add the discussion in proper format title like “CS101 Assignment / GDB No 01 Solution & Discussion Due Date: ___________”

Then copy Questions from assignment file and paste in Discussion.

 

http://bit.ly/vucodes (For Assignments, GDBs & Online Quizzes Solution)

http://bit.ly/papersvu (For Past Papers, Solved MCQs, Short Notes & More)

Click Here to Search (Looking For something at vustudents.ning.com?)

Click Here to Join (Our facebook study Group)

CS602 Computer Graphics Assignment 1 Solution Fall 2019

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <graphics.h> //graphics header file
#include <math.h>
int main()
{
int gd=DETECT, gm;
initgraph(&gd,&gm,(char*)" ");
setcolor(WHITE);
settextstyle(DEFAULT_FONT, HORIZ_DIR, 2);
outtextxy(10, 20, (char*)"BC123456789"); //your VU-ID
//variables
int x1=150;
int y1=100;
int x2=x1*4;
int y2=y1*5;
int p=x1*2;
int q=x1*3;
int r=y1*2;
int s=y1*3;
int t=y1*4;
setcolor(YELLOW);
rectangle(x1,y1,x2,y2); //draws main rectangle
setfillstyle(SOLID_FILL,LIGHTBLUE);
floodfill(151,101,YELLOW); //fill rectangle with LIGHT BLUE COLOR
line(p,y1,p,y2); //vertical line 1 inside main rectangle
line(q,y1,q,y2); //vertical line 2 inside main rectangle
line(x1,r,x2,r); //horizontal line 1 inside main rectangle
line(x1,s,x2,s); //horizontal line 2 inside main rectangle
line(x1,t,x2,t); //horizontal line 3 inside main rectangle
//row 1 rectangles
rectangle(x1+10,y1+10,p-10,r-10);
rectangle(p+10,y1+10,q-10,r-10);
rectangle(q+10,y1+10,x2-10,r-10);
//row 2 rectangles
rectangle(x1+10,r+10,p-10,s-10);
rectangle(p+10,r+10,q-10,s-10);
rectangle(q+10,r+10,x2-10,s-10);
//row 3 rectangles
rectangle(x1+10,s+10,p-10,t-10);
rectangle(p+10,s+10,q-10,t-10);
rectangle(q+10,s+10,x2-10,t-10);
//row 4 rectangles
rectangle(x1+10,t+10,p-10,y2-10);
rectangle(p+10,t+10,q-10,y2-10);
rectangle(q+10,t+10,x2-10,y2-10);
//row 1 circles
circle(x1+75,y1+50,30);
circle(p+75,y1+50,30);
circle(q+75,y1+50,30);
//row 2 circles
circle(x1+75,r+50,30);
circle(p+75,r+50,30);
circle(q+75,r+50,30);
//row 3 circles
circle(x1+75,s+50,30);
circle(p+75,s+50,30);
circle(q+75,s+50,30);
//row 4 circles
circle(x1+75,t+50,30);
circle(p+75,t+50,30);
circle(q+75,t+50,30);
setfillstyle(SOLID_FILL,BLACK); //fills black color in all inside rectangles
setfillstyle(CLOSE_DOT_FILL,WHITE); //fills 1st row of rectangles with close_dots
floodfill(x1+11,y1+11,YELLOW);
floodfill(p+11,y1+11,YELLOW);
floodfill(q+11,y1+11,YELLOW);
setfillstyle(SLASH_FILL,WHITE); //fill 2nd row of rectangles with slash lines
floodfill(x1+11,r+11,YELLOW);
floodfill(p+11,r+11,YELLOW);
floodfill(q+11,r+11,YELLOW);
setfillstyle(BKSLASH_FILL,WHITE); //fills 3rd row of rectangles with back slash lines
floodfill(x1+11,s+11,YELLOW);
floodfill(p+11,s+11,YELLOW);
floodfill(q+11,s+11,YELLOW);
setfillstyle(WIDE_DOT_FILL,WHITE); //fills 4th row of rectangles with wide_dots
floodfill(x1+11,t+11,YELLOW);
floodfill(p+11,t+11,YELLOW);
floodfill(q+11,t+11,YELLOW);
setfillstyle(SOLID_FILL,MAGENTA); //fills all circles with magenta color
floodfill(x1+76,y1+51,YELLOW);
floodfill(p+76,y1+51,YELLOW);
floodfill(q+76,y1+51,YELLOW);
floodfill(x1+76,r+51,YELLOW);
floodfill(p+76,r+51,YELLOW);
floodfill(q+76,r+51,YELLOW);
floodfill(x1+76,s+51,YELLOW);
floodfill(p+76,s+51,YELLOW);
floodfill(q+76,s+51,YELLOW);
floodfill(x1+76,t+51,YELLOW);
floodfill(p+76,t+51,YELLOW);
floodfill(q+76,t+51,YELLOW);
getch();
closegraph();
}

CS602_Assignemt_01_Sloution_Fall_2019_VU_Ning

Link 

CS602_Assignemt_01_Sloution_Fall_2019_VU_Ning

CS602 ASSIGNMENT 1 SOLUTION FALL 2019 Due Date: 12 Nov 

errors hen is mn 

cs602 Assignment 1 solution fall 2019

Cs602 Assignment solution
Download graphics from lms

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <graphics.h> //graphics header file
#include <math.h>
int main()
{
int gd=DETECT, gm;
initgraph(&gd,&gm,(char*)" ");
setcolor(WHITE);
settextstyle(DEFAULT_FONT, HORIZ_DIR, 2);
outtextxy(10, 20, (char*)"BC170403596"); //your VU-ID
//variables
int x1=150;
int y1=100;
int x2=x1*4;
int y2=y1*5;
int p=x1*2;
int q=x1*3;
int r=y1*2;
int s=y1*3;
int t=y1*4;
setcolor(YELLOW);
rectangle(x1,y1,x2,y2); //draws main rectangle
setfillstyle(SOLID_FILL,LIGHTBLUE);
floodfill(151,101,YELLOW); //fill rectangle with LIGHT BLUE COLOR
line(p,y1,p,y2); //vertical line 1 inside main rectangle
line(q,y1,q,y2); //vertical line 2 inside main rectangle
line(x1,r,x2,r); //horizontal line 1 inside main rectangle
line(x1,s,x2,s); //horizontal line 2 inside main rectangle
line(x1,t,x2,t); //horizontal line 3 inside main rectangle
//row 1 rectangles
rectangle(x1+10,y1+10,p-10,r-10);
rectangle(p+10,y1+10,q-10,r-10);
rectangle(q+10,y1+10,x2-10,r-10);
//row 2 rectangles
rectangle(x1+10,r+10,p-10,s-10);
rectangle(p+10,r+10,q-10,s-10);
rectangle(q+10,r+10,x2-10,s-10);
//row 3 rectangles
rectangle(x1+10,s+10,p-10,t-10);
rectangle(p+10,s+10,q-10,t-10);
rectangle(q+10,s+10,x2-10,t-10);
//row 4 rectangles
rectangle(x1+10,t+10,p-10,y2-10);
rectangle(p+10,t+10,q-10,y2-10);
rectangle(q+10,t+10,x2-10,y2-10);
//row 1 circles
circle(x1+75,y1+50,30);
circle(p+75,y1+50,30);
circle(q+75,y1+50,30);
//row 2 circles
circle(x1+75,r+50,30);
circle(p+75,r+50,30);
circle(q+75,r+50,30);
//row 3 circles
circle(x1+75,s+50,30);
circle(p+75,s+50,30);
circle(q+75,s+50,30);
//row 4 circles
circle(x1+75,t+50,30);
circle(p+75,t+50,30);
circle(q+75,t+50,30);
setfillstyle(SOLID_FILL,BLACK); //fills black color in all inside rectangles
setfillstyle(CLOSE_DOT_FILL,WHITE); //fills 1st row of rectangles with close_dots
floodfill(x1+11,y1+11,YELLOW);
floodfill(p+11,y1+11,YELLOW);
floodfill(q+11,y1+11,YELLOW);
setfillstyle(SLASH_FILL,WHITE); //fill 2nd row of rectangles with slash lines
floodfill(x1+11,r+11,YELLOW);
floodfill(p+11,r+11,YELLOW);
floodfill(q+11,r+11,YELLOW);
setfillstyle(BKSLASH_FILL,WHITE); //fills 3rd row of rectangles with back slash lines
floodfill(x1+11,s+11,YELLOW);
floodfill(p+11,s+11,YELLOW);
floodfill(q+11,s+11,YELLOW);
setfillstyle(WIDE_DOT_FILL,WHITE); //fills 4th row of rectangles with wide_dots
floodfill(x1+11,t+11,YELLOW);
floodfill(p+11,t+11,YELLOW);
floodfill(q+11,t+11,YELLOW);
setfillstyle(SOLID_FILL,MAGENTA); //fills all circles with magenta color
floodfill(x1+76,y1+51,YELLOW);
floodfill(p+76,y1+51,YELLOW);
floodfill(q+76,y1+51,YELLOW);
floodfill(x1+76,r+51,YELLOW);
floodfill(p+76,r+51,YELLOW);
floodfill(q+76,r+51,YELLOW);
floodfill(x1+76,s+51,YELLOW);
floodfill(p+76,s+51,YELLOW);
floodfill(q+76,s+51,YELLOW);
floodfill(x1+76,t+51,YELLOW);
floodfill(p+76,t+51,YELLOW);
floodfill(q+76,t+51,YELLOW);
getch();
closegraph();
}

Cs602
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <graphics.h> //graphics header file
#include <math.h>
int main()
{
int gd=DETECT, gm;
initgraph(&gd,&gm,(char*)" ");
setcolor(WHITE);
settextstyle(DEFAULT_FONT, HORIZ_DIR, 2);
outtextxy(10, 20, (char*)"BC170403596"); //your VU-ID
//variables
int x1=150;
int y1=100;
int x2=x1*4;
int y2=y1*5;
int p=x1*2;
int q=x1*3;
int r=y1*2;
int s=y1*3;
int t=y1*4;
setcolor(YELLOW);
rectangle(x1,y1,x2,y2); //draws main rectangle
setfillstyle(SOLID_FILL,LIGHTBLUE);
floodfill(151,101,YELLOW); //fill rectangle with LIGHT BLUE COLOR
line(p,y1,p,y2); //vertical line 1 inside main rectangle
line(q,y1,q,y2); //vertical line 2 inside main rectangle
line(x1,r,x2,r); //horizontal line 1 inside main rectangle
line(x1,s,x2,s); //horizontal line 2 inside main rectangle
line(x1,t,x2,t); //horizontal line 3 inside main rectangle
//row 1 rectangles
rectangle(x1+10,y1+10,p-10,r-10);
rectangle(p+10,y1+10,q-10,r-10);
rectangle(q+10,y1+10,x2-10,r-10);
//row 2 rectangles
rectangle(x1+10,r+10,p-10,s-10);
rectangle(p+10,r+10,q-10,s-10);
rectangle(q+10,r+10,x2-10,s-10);
//row 3 rectangles
rectangle(x1+10,s+10,p-10,t-10);
rectangle(p+10,s+10,q-10,t-10);
rectangle(q+10,s+10,x2-10,t-10);
//row 4 rectangles
rectangle(x1+10,t+10,p-10,y2-10);
rectangle(p+10,t+10,q-10,y2-10);
rectangle(q+10,t+10,x2-10,y2-10);
//row 1 circles
circle(x1+75,y1+50,30);
circle(p+75,y1+50,30);
circle(q+75,y1+50,30);
//row 2 circles
circle(x1+75,r+50,30);
circle(p+75,r+50,

RSS

© 2019   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.