Lecture4 – Programming Basics III

slides 17.10.2016 (ignore the date in the slides)

lecture4_filesWhy Object Oriented Programming

Exercise 2:

a) Make 2 buildings.

You need to create another building in OOP2Visuals class and update setup() and draw() methods to draw them both.
Subject to constraints:
1. Buildings should be fully visible on a screen and should not overlap;
2. They should differ in, at least, something.

b) Change roof type.

You need to create another Roof implementation.
1. Create a new class with your own name, e.g.
class YouRoofClassName extends Roof { .. }
2. Overwrite draw() method, so it draws your custom roof.
3. Change one of the buildings from exercise (a) to use your roof.

c) Change Storey: make a storey with balcony.

You need to do another class
class BalconyStorey extends Story {..}
Then you need to modify it the same way as we did for GroundFloor class;
the only difference is that time we need to draw a balcony on top of a floor, not a door.