Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Faculty of Science Stage: 2nd

Department of Computer Date: 29 / 5 / 2016


Subject: OOP (Practical) Time: 100 minutes

Final Examination, First Semester (2015-2016) ( 1 ) Attempt

1. Design and implement Tab control which contains 10 tab pages. We classify the tabs into two groups:
the tabs less than 5 and the tabs bigger than 5: (0, 1, 2, 3 and 4) and (5, 6, 7, 8, 9). To move between the
tabs less than 5, the color of any tab becomes Yellow. To move between the tabs bigger than 5, the
color of any page becomes Green. To move from a tab page less than 5 to a tab page bigger than 5 and
vice versa the color of the destination becomes Red.

2. Design and implement an MDI form that contains 3 forms inside. The first form is used to determine the
size of pen and the second form is used to determine the type of color. The third form should contain a
white label and the user should be able draw on the label based on the color and size determined in the
previous forms

Sizes: 12, 16, 20

Color: Red, Black, Green, Blue

You are free to use Radio buttons, buttons or any other elements such as listbox or etc.

3. Write a program to copy and paste all words of a txt file into a new created file but in the reverse mode
as shown below

Input file: This is just for test

Output file: test for just is This


4. Design and implement the Shape hierarchy shown below. The square class and circle class need two
points, while the tringle class needs 3 points to draw. For all classes two points are common while the
tringle class require an extra node. All classes have two methods: Draw() and Perimeter().

The Draw method draws the determined object on the form.

Note to draw a square you only need the top two nodes, then you can draw the square totally. To draw
a circle you need two nodes; one node for the center and one node on the perimeter; then you can
calculate the radix and draw the circle. To draw the tringle you need to have all three nodes.

The Perimeter method calculates the perimeter of the shape.

Shape

DrawLine( Pen p, int x1, int y1, int x2, int y2 )

To calculate the distance between two nodes use

Math.Sqrt(x*x + y*y)

Good Luck!

Dr. Hakem Bitollahi

Head of Department Examiner

You might also like