Self-Test Questions


Suggested Projects

  1. Draw Sequence Diagram:   Draw a UML sequence diagram of the SimpleEngine constructor call. Refer to the code supplied in examples 11.25 through 11.38.

  2. Draw Sequence Diagram:   Draw a UML sequence diagram of the SimpleEngine start() method.

  3. Draw Sequence Diagram:   Draw a UML sequence diagram of the SimpleEngine incrementThrust() method.

  4. Extend Functionality:   Extend the functionality of the Employee example given in this chapter. Create a subclass named PartTimeEmployee that extends HourlyEmployee. Limit the number of hours a PartTimeEmployee can have to 30 hours per pay period.

  5. Extend Functionality:   Extend the functionality of the aircraft engine simulation program given in this chapter. Create several more types of pumps and sensors. For instance, you might create an OilPump or an OilTemperatureSensor class. What other types of parts might you want to model in the simulation? Create different types of engines that consist of different types of parts. Use your imagination!

  6. Oil Tanker Pumping System:   Design and create an oil tanker pumping system simulation. Assume your tanker ship has five oil cargo compartments as shown in the diagram below.

    image from book

Each compartment can be filled and drained from either the port or starboard service header. The oil pumping system consists of 14 valves numbered 1 through 16. Even-numbered valves are located on the port side of the ship and odd-numbered valves are located on the starboard side of the ship. (Valve numbers 13 and 15 are not used.)

The system also consists of two pumps that can be run in two speeds, slow or fast speed, and in two directions, drain and fill. When a pump is running in the drain direction it is taking a suction from the tank side, when running in the fill direction it is taking a suction from the hull side. Assume a pumping capacity of 1000 gallons per minute in fast mode.

Each tank contains one tank level indicator that is a type of sensor. The indicators sense a continuous tank level from 0 (empty) to 100,000 gallons.

Your program should let you drain and fill the oil compartments by opening and closing valves and starting and setting pump speeds. For instance, to fill tank A quickly you could open valves 1, 2, 11, 12, 14 & 16, and start pumps P1 and P2 in the fill direction in the fast mode.




Java For Artists(c) The Art, Philosophy, and Science of Object-Oriented Programming
Java For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
ISBN: 1932504052
EAN: 2147483647
Year: 2007
Pages: 452

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net