Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

AOA To All....

Assignment No. 01
Semester: Fall 2014

CS602: Computer Graphics


Total Marks: 20


Due Date:25/11/2014



Please read the following instructions carefully before submitting assignment:

Read and follow the instructions given in document inside the Help folder attached.

It should be clear that your assignment will not get any credit if:

  • The assignment is submitted after due date.
  • The submitted assignment does not open or file is corrupt.
  • Solution is copied from any other source.


The objective of this assignment is to;

  • Learn and practice basic concepts of computer graphics using Dev-C++. (you can download Dev-C++ setup from LMS)
  • Learn to draw text, rectangle and circles using graphics library functions.



In this assignment, you are provided with a small startup code attached with this assignment in folder “StartupCode”. Your job is to slightly modify this code as desired in this assignment.

First, you need to understand the working of the given code and execute it in Dev-C++. This program essentially draws some text on screen with a rectangle and two circles labeled as “Earth” and “Moon” and a large circle represents the orbit of Moon as shown in following screenshot.


Initially, you need to open project file in Dev-C++. After successful compilation and execution, you will see the output. You will notice that small circle representing the Moon is blinking. The blinking effect is introduced just by simple continuous drawing this circle in WHITE and BLACK colors with some delay in between. When circle is drawn in WHITE color, it appears on the screen. After some delay, we draw the same circle in BLACK color which makes the circle disappear because our background color is also black. Delay of 100ms is introduced by using delay() function.

Your Task

Your task is to slightly modify this code in order to introduce motion effect to the Moon as shown in “Earth_Moon.exe”. This simply requires only few lines of code to modify the x and y coordinates of the Moon. You shall add your code in the areas indicated with comments “Add your code here to modify coordinates of Moon”.

Hint: You have to use your mathematical skills in order to calculate the coordinates of Moon along the orbit.

Screenshot of the desired  output:



You are required to submit your solution through LMS in zip format containing two files.

  • Your Project in zipped form containing both .dev and .cpp file.
  • An MS Word document containing screenshot of your program output/execution and your own Student-ID must be visible in the screenshot.




Views: 1967


Replies to This Discussion

Please Discuss here about this assignment.Thanks

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions.

Discuss assignment idea

dosto discuss start karo yar

Dear Students Don’t wait for solution post your problems here and discuss ... after discussion a perfect solution will come in a result. So, Start it now, replies here give your comments according to your knowledge and understandings....

Just modification karni ha code sara dia ha bus small circle k color change and positon change ka code hum nay add karna ha given code ma

mr adi code chang ks trhn krna hai hai ap hi help kar do

how do we write the code for changing the position of the moon in the orbit in blinking position???

in which format we write the code ???

mara to existing code hi execute nae ho rha 

Any IDEA???? please

Help k folder me jo file hai Wo read karen ap./// Insha Allah ho jae ga execute

 nahi ho rha mujh say tou  koi tou help karo . 

Assignment nhi open ho rha mera :( compiler ki setting kia karni ho gi is kay liye? 


Looking For Something? Search Below

Top Trends 

Latest Activity

Profile IconMuhammad Imran, Hafsa kalsoom, Melissa Dorn and 3 more joined Virtual University of Pakistan
1 hour ago
Melissa Dorn replied to + M.Tariq Malik's discussion Reality of Modern Co-Education System of Pakistan
12 hours ago
memon added a discussion to the group MGT610 Business Ethics
Profile IconTahir Abbas, Esha Arooj and Muhammaad Arif joined Virtual University of Pakistan
Profile IconStudent, Batool, Suha Khan and 3 more joined Virtual University of Pakistan
Nida Arshad Javaid Ch posted photos
subhan ali joined + M.Tariq Malik's group
Suha Khan joined + M.Tariq Malik's group

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

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