Question: OBJECT ORIENTED PROGRAMMING (OOP) SPRINKLER SIMULATION In this assignment, you are to create a water sprinkler control system for a property using OOP design. The
OBJECT ORIENTED PROGRAMMING (OOP) SPRINKLER SIMULATION
In this assignment, you are to create a water sprinkler control system for a property using OOP design. The water system is fed by a main water supply line that can handle a maximum flow rate of 20 (max f=20). The property is dividing into 3 zones named ZONE0, ZONE1, and ZONE2 each having a maximum water flow rate of f=10, f=3, and f=13. Each zone has its own set of sprinklers: ZONE0 has 4 sprinklers, ZONE1 has 3 sprinklers, ZONE2 has 7 sprinklers. Each sprinkler draws a different flow rate from the zone it belongs to. The flow rates drawn from each sprinkler and the overall pictorial representation of the property is shown in the picture

Design a system that provides a main menu that appears as follows:
Main Menu:
1. Turn off water supply to an entire zone. (1% of PART II Marks)
2. Turn on water supply to an entire zone. (1% of PART II Marks)
3. Change the maximum water capacity usage of a zone. (1% of PART II Marks)
4. Turn on any individual sprinkler. (1% of PART II Marks)
5. Turn off any individual sprinkler. (1% of PART II Marks)
6. Change the maximum water capacity for the entire property. (1% of PART II Marks)
7. Move the gardener to another zone. (1% of PART II Marks)
8. Display a report on the current status of all zones, sprinklers, and total water flow in use for the system. (4% of PART II Marks)
Example Report:
ZONE 1 (WATER SUPPLY = ON, CURRENT FLOW = 6, MAX FLOW=10)
sprinkler 0 (STATUS = ON, FLOW IF ON = 1)
sprinkler 1 (STATUS = OFF, FLOW IF ON = 3)
sprinkler 2 (STATUS = OFF, FLOW IF ON = 6)
sprinkler 3 (STATUS = ON, FLOW IF ON = 5)
ZONE 2 (WATER SUPPLY = OFF, CURRENT FLOW = 0, MAX FLOW=13)
sprinkler 0 (STATUS = ON, FLOW IF ON = ...)
sprinkler 1 (...)
sprinkler 2 (...)
TOTAL WATER USAGE = 6, MAX USAGE = 20
Initial Conditions:
Assume at start-up that all the sprinklers are turned "off" and all zones water supply intake is set to "off". Also assume the gardener is in zone 1.
Restrictions:
1. You can't turn on a sprinkler (menu option 4) if the zone it belongs to is turned off (menu option 1). (2% of PART II Marks)
2. You can't turn on a sprinkler (menu option 4) if doing so would exceed the maximum water usage allowed for that zone. (2% of PART II Marks)
3. You can't turn on a sprinkler (menu option 4) if doing so would exceed the maximum water usage allowed for the entire property. (3% of PART II Marks)
4. You can't turn on a sprinkler (menu option 4) if the gardner is in the zone the sprinkler belongs to. (2% of PART II Marks)
5. You can't turn on the water supply to a zone (menu option 2) if the gardner is in that zone UNLESS all the sprinklers within that zone are set to OFF (menu option 5). (3% of PART II Marks)
6. A gardener can not move into a zone (menu option 7) where there are any sprinklers turned on UNLESS that zone's water supply is off. (3% of PART II Marks)
7. You can't change the maximum water capacity usage of a zone (menu option 3) if the number you change it to is less than the total flow currently in use at that zone. (2% of PART II Marks)
8. You can't change the maximum water capacity for the entire property (menu option 6) to a number that is less than the currently in use combined flow of all the zones. (2% of PART II Marks)
MAIN WATER LINE. Max f=20 f=2 f=2 f=2 f=4 ZONE 1 max f=3 f=1 f=5 f=3 ZONE 2 max f=13 ZONE O f=1 m max f=10 f=2 f=5 f=3 f=6 MAIN WATER LINE. Max f=20 f=2 f=2 f=2 f=4 ZONE 1 max f=3 f=1 f=5 f=3 ZONE 2 max f=13 ZONE O f=1 m max f=10 f=2 f=5 f=3 f=6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
