[go: up one dir, main page]

0% found this document useful (0 votes)
26 views5 pages

Computer Graphics Lab Assignm, en

This document contains two computer graphics lab assignments from Wolaita Sodo University. The first assignment asks students to draw pictures and write programs that output them. It includes code to draw two cars, a man, and instructions to import graphics libraries. The second assignment also asks students to draw pictures and write the corresponding code. It includes code to draw a fish, car, rectangle, circle, and imports graphics libraries. It also contains a table of names and student IDs.

Uploaded by

mintewalker187
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views5 pages

Computer Graphics Lab Assignm, en

This document contains two computer graphics lab assignments from Wolaita Sodo University. The first assignment asks students to draw pictures and write programs that output them. It includes code to draw two cars, a man, and instructions to import graphics libraries. The second assignment also asks students to draw pictures and write the corresponding code. It includes code to draw a fish, car, rectangle, circle, and imports graphics libraries. It also contains a table of names and student IDs.

Uploaded by

mintewalker187
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

WOLAITA SODO

UNIVERSITY

Computer
Graphics

LAB
ASSIGNMENT

Computer Science

Year 2023 G.C


Published by Mintesnot Abebe 01
Computer Science
Section II - Group one

Email: web: Cell:


Wsusec2grp1@yahoo.com 0963369219 0963369219

Table of contents
1. Draw pictures and write a program that gives or output it. ..................................................................................................... 3
2. Draw pictures and write a program that gives or output it. ..................................................................................................... 4

Published by Mintesnot Abebe 02


1. Draw pictures and write a program that gives or output it.
#include<graphics.h>
int main(){
initwindow(800,600,"Assignment 1");
//car number 1
line( 150, 100, 242, 100);
ellipse(242, 105, 0, 90, 10, 5);
line(150, 100, 120, 150);
line(252, 105, 280, 150);
line(100, 150, 320, 150);
line(100, 150, 100, 200);
line(320, 150, 320, 200);
line(100, 200, 110, 200);
line( 320, 200, 310, 200);
arc(130, 200, 0, 180, 20);
arc( 290, 200, 0, 180, 20);
line( 270, 200, 150, 200);
circle(130, 200, 17);
circle(130, 200, 8);
circle(290, 200, 17);
circle(290, 200, 8);
//car number 2
setcolor(2);
line( 500, 100, 592, 100);
ellipse(592, 105, 0, 440, 10, 5);
line(500, 100, 470, 150);
line(602, 105, 630, 150);
line(450, 150, 670, 150);
line(450, 150, 470, 150);
line(450, 150, 450, 200);
line(672, 150, 672, 200);
line(450, 200, 470, 200);
line( 620, 200, 630, 200);
arc(490, 200, 0, 180, 20);
arc( 650, 200, 0, 180, 20);
line( 510, 200, 620, 200);
circle(490, 200, 17);
circle(490, 200, 8);
circle(650, 200, 17);
circle(650, 200, 8);
//man in the blue color
setcolor(1);
circle(150,450,35);
line(150,485,150,650);
line(150,550,120,580);
line(150,550,180,580);
line(150,650,120,680);
line(150,650,180,680);

getch();
Published by Mintesnot Abebe 03
return 0;
}
2. Draw pictures and write a program that gives or output it.

#include<graphics.h>
//wsu computer graphics
// dev by Minte
int main(){
initwindow(800,720,"assignment 2");
//fish
ellipse(520,200,30,330,90,30);
circle(450,193,3);
line(430,200,450,200);
line(597,185,630,170);
line(597,215,630,227);
line(630,170,630,227);
line(597,200,630,200);
line(597,192,630,187);
line(597,207,630,213);
line(500,190,540,150);
line(530,190,540,150);
//car
line( 150, 100, 242, 100);
ellipse(242, 105, 0, 90, 10, 5);
line(150, 100, 120, 150);
line(150, 100, 150, 150);
line(180, 100, 180, 150);
line(220, 100, 220, 150);
line(242, 100, 242, 150);
line(252, 105, 280, 150);
line(100, 150, 320, 150);
line(100, 160, 320, 160);
line(100, 170, 320, 170);
line(100, 150, 100, 200);
line(320, 150, 320, 200);
line(100, 200, 110, 200);
line( 320, 200, 310, 200);
arc(130, 200, 0, 180, 20);
arc( 290, 200, 0, 180, 20);
line( 270, 200, 150, 200);
circle(130, 200, 17);
circle(290, 200, 17);

//rectangle
line(50,290,190,290);
line(50,290,50,440);
line(50,440,190,440);
line(190,290,190,440);
//circle
circle(400,400,70);

getch();

return 0;
}

Published by Mintesnot Abebe 04


No Name ID
1 Mintesnot Abebe Geta CS/WE/128/12
2 Mebratu Markos CS/WE113/12
3 Konjit Fanta CS/WE/111/12
4 Kidist Meskele CS/WE/110/12
5 Merihun Ayele CS/WE/120/12

Published by Mintesnot Abebe 05

You might also like