As a team, fork this repository to an Organization and submit the URL of your fork via the Student Portal. Each teammate will submit the SAME URL.
- Objective: To implement a system representative of a Farm environment
- Purpose: To demonstrate multi-inheritence design issues
- Prerequesites: A
UMLapproved by an instructor.
- Consider a system in which
EatercaneatanEdibleobject.NoiseMakercanmakeNoiseAnimalis aNoiseMakerandEaterHorseis anAnimalandRideableChickenis anAnimaland aProducewhichyieldanEdibleEggifhasBeenFertilizedflag isfalse.
RidercanmountanddismountaRideableobject.BotanistcanplantaCropin aCropRow.CropRowcan store manyCrop.Fieldcan store manyCropRowVehicleareNoiseMakerandRideableFarmVehiclecanoperateon aFarmTractoris aFarmVehiclewhich canharvestaCrop.
AircraftareVehiclewhich canflyCropDusteris aFarmVehicleandAircraftwhich canfertilizeaCropRow
ProducecanyieldanEdibleobject depending on theirhasBeenFertilizedflag.Cropis aProducewhich canyieldanEdibleobject depending on itshasBeenHarvestedandhasBeenFertilizedflag.CornStalkis aCropwhich canyieldaEarCornTomatoPlantis aCropwhich canyieldaTomato
PersoncanmakeNoiseand caneatanEdibleobject.Farmeris anEater, aRider, aBotanist, and aPerson.Stablestores manyHorse.FarmHousestores manyPersonChickenCoopstores manyChickenFarmstores manyStable, manyChickenCoop, and a singleFarmHouse
Froilan, aFarmerhas aFarmconsisting of1
Fieldof 5CropRow.- Row 1 has
Corn - Row 2 has
Tomato - Row 3 and beyond grows arbitrary vegetation.
- Row 1 has
15
Chickenacross 4ChickenCoop10
Horseacross 3Stable.2
FarmVehicle1
AircraftHis sister,
Froilanda, is aPilotwho uses aCropDuster.
Create test cases which simulate a typical work-week for
FroilanandFroilanda.- The accumulation of your test cases should ensure at least 80% test coverage.
The first few weekdays have already been considered for you.
Create a separate Test class for each day in the following scenario.
- As a farmer, Froilan must stick to a rigorous agricultural routine.
Every morning,
FroilanandFroilandabegin their morning by- Riding each
Horsein eachStable. - Feeding each
Horse3 ear ofCorn. - For breakfast,
Froilaneats 1EarCorn, 2Tomoato, and 5Egg.Froilandaeats 2EarCorn, 1Tomoato, and 2Egg.
- Riding each
Sunday,Froilanplants 3 different type ofCropin his first, second, and thirdCropRow.On
Monday, his sister,Froilandauses theCropDustertoflyover theFieldandfertilizeeach of theCropRowOn
Tuesday,Froilanuses hisTractortoharvesteachCropin eachCropRow.
- As a farmer, Froilan must stick to a rigorous agricultural routine.
- ask yourselves: "How do we apply Generics to implement our design CLEANLY?"