You are on page 1of 1

DA-IICT , Gandhinagar IT-114-Object Oriented Programming Test-04 (Take Home Test) Submission Due: 29/02/2012 11PM.

Max Marks: 30 Do following1. Extend Triangle class discussed in lectures such that it implements java.awt.Shape, and name it to TriangleShape. Note: you can have empty implementation of interface methods that are not required for needed functionality in following questions. 2. Also add following methods to the new class. setLocation(Point location) // sets location of the triangle in the drawing context. Point getLocation() 3. Create a class TriangleComponent. In paintComponent method of this class draw a TriangleShape object of size (100, 200, 200) using draw service of Graphics2D. 4. Create a class TriangleComponentTester that shows a triangle component object. Note for development: 1. TriangleShape class should not depend on Graphics2D, that is no where in its implementation you should be using objects of Graphics2D. 2. paintComponent method should not be drawing rectangle itself it should simply send the triangle object to draw message to Graphics2D object. 3. You can make necessary assumptions (and mention in your submission in a separate file readme.txt) for aspects that you think are un-specified for required functionality. 4. Follow all java coding conventions discussed in lectures. Note for submission: 1. Upload code of tested classes in a single compressed file as ???_test04.zip/tar.gz, where ??? is replaced by last three digits of your ID. 2. Do not copy and let others copy your program. Either case will lead to zero marks straight. 3. Do not wait for last minutes for submissions. Early submissions will be earning incentives marks upto 50% of max marks depending upon your submission day and time. 4. You can delay the submission if you are not able to finish by due date. However your maximum marks will be decreased by 20% for every 24 hours delay.

You might also like