Sunday, 21 July 2013

IT2305  java Lab programs:

1. Develop with suitable hierarchy, classes for Point, Shape, Rectangle, Square, Circle, Ellipse, Triangle, Polygon, etc.  Design a simple test application to demonstrate dynamic polymorphism.

Algorithm:
step 1:Define the class point.
step 2:Define the method show().
step 3:Teminate the class.
step 4:Define the class shape which extends from point.
step 5:Define the class show() make a call for the super class show().
step 6:Terminate the class.
step 7:Define the class rectangle that extend from the class shape.
step 8:Declar the datamembers l&b in integer.
step 9:Define the method getdata() to get the l and b values.
step 10:Define the show() to display the area.
step 11:Terminate the class.
step 12:Define the class square that extend from the class shape.
step 13:Declar the datamembers a in integer.
step 14:Define the method gdata() to get the a values.
step 15:Define the sarea() to display the area.
step 16:Terminate the class.
step 17:Define the class circle and triangle that extend from the class shape and display the result.
step 18:Define the shapetest and define the main() method in it.
step 19:create objects for the classes rectangle,square,circle and triangle and access their methods.
step 20:display the result.
step 21:Terminate the main and class.

2.Matrix addition and Multiplication

3.Arrays Class methods.
Note:
1.Write the algorithm for above three programs
2.Without the observation don't enter into lab.

No comments:

Post a Comment