ComputerProgrammingandBasicSoftwareEngineering5.ObjectsandClassesinC++YesBAClickDog?Play dog soundINoYesClickCat?Play cat soundINoYesClick Sheep?PlaysheepsoundINoYesClickHorse?Playhorse soundINoKYesEndClickEnd?No
Computer Programming and Basic Software Engineering 5. Objects and Classes in C++ A Click Dog? Click Cat? Click Sheep? Click Horse? Click End? Play dog sound B Play cat sound Play sheep sound Play horse sound End Yes Yes Yes Yes Yes No No No No No
ComputerProgrammingandBasicSoftwareEngineering5.ObjectsandClassesinC++Example-step3:divideintomodulesFrom the flow chart, identify the classes reguired and theirfunctions.CatClass.hHorseClass.hDogClass.hclass CATclassHORSE(SheepClass.hclassDOGpublic:1classSHEEPintDrawShape0public:intPlaySoundO;publicintDrawShapeO;int PlaySoundO;intDrawShape0public:办intPlaySoundO;intDrawShapeO;int PlaySoundO;;;K
Computer Programming and Basic Software Engineering 5. Objects and Classes in C++ Example – step 3: divide into modules • From the flow chart, identify the classes required and their functions. { public: int DrawShape(); int PlaySound(); }; DogClass.h : : class DOG { public: int DrawShape(); int PlaySound(); }; CatClass.h : : class CAT { public: int DrawShape(); int PlaySound(); }; SheepClass.h : : class SHEEP { public: int DrawShape(); int PlaySound(); }; HorseClass.h : : class HORSE