Ecosyste.ms: Repos
An open API service providing repository metadata for many open source software ecosystems.
GitHub / BrendanJohn / cscie55.hw2
Homework 2: Expanded Elevator Model w/ Java Exceptions / Zoo animal behaviors
JSON API: https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrendanJohn%2Fcscie55.hw2
Stars: 0
Forks: 0
Open Issues: 0
License: None
Language: HTML
Repo Size: 1.58 MB
Dependencies:
83
Created: over 5 years ago
Updated: over 5 years ago
Last pushed: over 5 years ago
Last synced: over 1 year ago
Files
Loading...
Readme
Loading...
Dependencies
requirements.txt
pypi
- Add3methodstoeachofyourHomework1zooanimalclasses. *
- Allofthefollowingclasses ,aswellastherefactored
- Amorecommonapproachtotestingistowriteself-testingcode.Youwriteatestthatsetsupinitialconditions ,movestheElevatorafewtimes,andthenexaminesthestateoftheElevatortoseethatallisasexpected.Aprogramlikethishasnooutputifallworkswell.However,ifanystateisnotasexpected,thisresultsinanassertionfailure,whichisprinted,andthattestisthenreportedasfailing.
- Arraysizingandindexingpresentpotentiallyfatalgotchas.Ifyoucreateanarraytorepresentdatafor7Floorsandyousizethearraytobe7cells ,its0thelementwillmaptofloornumber1andits6thelementwillcorrespondtofloor
- Asbefore ,submittheoutputyougetwhenyourunyourprogram.Ifallgoeswell,thereshouldbeminimaloutput,e.g.
- AstheElevatorboardsapassengerwaitingonaFloor ,howdoestheFloorlearntodecrementthecountofwaitingpassengers
- Becauseyouarerunningajunittest ,theclassyourunisorg.junit.runner.JUnitCore.Thatis,themainmethodisinJUnitCore.Thereisoneargument,thenameofthetest
- CLASSPATH =<path_to_lib_directory>
- CSCIE-55 *
- Codeorganization *
- DesignConsiderationsandGotchas *
- Due *
- Elevator.boardPassenger *
- ElevatorTest.java *
- Fall2018 *
- ForgeneralbackgroundonJUnitseepage *
- Forlocal runningoftests,youcancreateatemporaryenvironmentvariablenamedCLASSPATHasfollows
- FredEvers *
- Furtherdesignconsiderations.Homework2isabigexpansionofthesimulationmodel.Structurallytherearethreenewclasses.Intermsofdata ,thebigchangeisthepresenceofpassengerswaitingonfloors.ThebigchangeinbehavioristhatElevator.move
- GettingstartedwithJUnit *
- Grading *
- Homework2 *
- HowdoesaFlooracquirewaitingpassengers *
- Ifyoudon *
- InHomework1 ,youdemonstratedthatyourcodewasworkingbywriting
- InorderforJavatofindtheclassesitistorun ,itemployswhatiscalledthe
- Insteadofwritingamain *
- Inthiscase ,Elevator.boardPassenger
- IrecommendadirectorybeneathyourJavaSourceRoot named
- ItshouldbeclearfromtherequirementsthattheremustbecommunicationbetweenFloorobjectsandElevatorobjects.ThisisinorderthattheElevatorknowswhentherearepassengerswaitingtoboardwhenitarrivesataFloorandthattheElevatorcantellitscurrentFloorwhenithasboardedoneofthewa ,yourmodelmustmaintaindataintegrity.Therearedifferentdesignapproachestoachievethis.It
- JUnitversion4.11 *
- LastModified *
- Lion.java *
- OK *
- OnmyLinuxmachine ,thecommandtorunthetestcodeisasfollows
- Overview *
- Part1. *
- Part2. *
- Refactor youranimalclassesfromHW1intoadirectorystructureasfollows
- Revisethepackagenamesofyourexistingclassestoreflecttherelocationasfollows *
- SpecificationofRequirements *
- StartingwithElevatorfromhomework1orfromscratch ,addthefollowingthepublicmethodsandfields
- Tasks *
- Testing *
- TheBuildingclass *
- TheElevator ,FloorandBuildingclassesallgointothepackagecscie55.hw2.Ifyoudefineanyadditionalclasses,theyshouldalsogointothispackage
- TheElevatorFullExceptionclass *
- TheElevatorclass *
- TheElevatorfromlastassignmentthatwillberefactoredandreused.Besurethepackagenamematchedthehw2specification. *
- TheElevatormovesexactlyasitdidlasttime ,stoppingatFloorstodisembarkpassengers,andtopickupnewpassengers.Butnow,ifapassengertriestoboardtheElevatorwhenitisalreadyloadedtocapacity,anElevatorFullExceptionwillbethrown.Thatshouldpreventthepassengerfromboarding.
- TheElevatormovespassengersbetweenFloors.TheElevatorandalloftheFloorsarepartofaBuilding. *
- TheElevatorwilllimitthenumberofpassengersitcancarry ,throwinganElevatorFullExceptionifanattemptismadetoboardpassengerspastthislimit.
- TheFloorclass *
- Thefirstthingtodoistodownloadthetestcode. TheclassofthisJavacodeiscscie55.hw2test.ElevatorTest.Notethatthepackageiscscie55.hw2test.
- Themostcommonself-testingframeworkforJavaisJUnit. *
- Therearethreenewtypes ofobject.
- Thesespecificationsarerequirements.Assuch ,theyspecifythingsthatmustbedoneinanycorrectimplementation.Youare,ofcourse,freetoaddothermethods
- ThishomeworkextendsHomework1inthefollowingways *
- Thisisanewclass ,representingoneofthefloorsthattheElevatorcanvisit.Itshouldhavethefollowingpublicmethods
- Thisisanewclass ,whichkeepstrackofoneElevatorandmultipleFloors.Itprovidesaccesstotheseobjectsfortests.Buildinghasthefollowingpublicmethodsandfields.
- Thisneedstobeapublicclass ,extendingjava.lang.Exception.ElevatorFullException,likeanyotherexception,mustbethrownwhensomethingoutoftheordinaryhappens.Becausewedonotwantthisexceptiontoendexecutionofyourprogram,someothercodemustcatchElevatorFullExceptionandhandlethesituation,
- Time *
- WhileitisrecommendedthatyouextendyourHomework1code ,thatisnotrequired,andyoumayprefertostartHomework2fromscratch.Eitherapproachisfine.TherequirementsgivenbelowarewrittenasanextensionoftheHomework1requirements.
- Yourcodeshouldbestructuredsomethinglikethis *
- Yoursubmissionshouldincludethefollowing *
- Youwillneedtoadjustthisforyourenvironmentandthelocationofthehomeworkclassesonyourmachineiftheydifferfromabove. *
- YouwillneedtodecidewhatfieldstheFloorclassshouldhave.NotethattomeetthefirsttworequirementsaFloorobjectmustretainapieceofstatethatrecordsthenumberofpassengersithaswaitingforanElevator. *
- Youwillneedtodownloadtwojarfiles ,andincludethemonyourclasspath.Thetwojarfilesare
- allHW2classes *
- animals *
- cscie55 *
- elevator.boardPassenger *
- hamcrest-core-1.3.jar *
- hw2 *
- hw2test *
- java *
- java-classpath *
- junit-4.11.jar *
- lib *
- main *
- src *
- try *
- zoo *