ICT283_Assignment1Doc _Tran Man Nhi_33778802.docx - Murdoch...

This preview shows page 1 - 5 out of 20 pages.

Murdoch UniversityICT283 Data Structure and Abstraction(TJA 2021)Individual Assignment 2DocumentationStudent Name: Tran Man NhiStudent Number: 3378802CT Number : 02925571
Table of ContentsUML Diagram.............................................................................................................................................2Data Dictionary...........................................................................................................................................3Vector class.............................................................................................................................................3Date class................................................................................................................................................5Time class...............................................................................................................................................7Weather class.........................................................................................................................................8Windlog class.........................................................................................................................................9BinarySearchTree class.......................................................................................................................10Implementation class...........................................................................................................................12Algorithm..................................................................................................................................................13Implementation.cpp..............................................................................................................................13Main.cpp................................................................................................................................................15Test plan....................................................................................................................................................16UML DiagramLegendAssumption2
-Windlog class is composed of Date, Time and Weather, when ever the elements of Date,Time or Weather is deleted the element of also will be deleted. In other words, theWindlog's life cycle is dependent on the Date, Time and Weather’s life cycle in part-whole relationship. The Windlog contains information about date, time and weather(windspeed, solar radiation, air temperature)-Vector is type of class that cannot be used until thet are realized.Data DictionaryBST classNameTypeProtectionDescriptionRationaleAttributesT pointerPrivatePointer to the listRequire to make new adynamic array of thepointers.T pointerPrivatePointer to the end of thelistRequire to make new adynamic array of thepointers.T pointerPrivatePointer to the beginningof the listRequire to make new adynamic array of thepointers.IntPrivateThe number of elementsare usedNeeded for vecor’sfunctionIntPrivateThe allocated size of thelistNeeded for vecor’sfunctionFunctionsProcedurePublicDefault constructor. Thisconstructor create a listwith default capacity of10When there is noconstructor, a vectorobject cannot beinitialized with defaultvalues.ProcedurePublicConstructor withparameter. Thisconstructor create a listwith n elementsThis is needed for thevector object to beinitialized with allocatedand initial values.VoidPublicThis function is to createa list with provided3
capacity sizepushBack(constT& elements)voidPublichis function is to addelement at the end ofVectorThe element must bestored in chorologicalorder in the array from therecord file. Which elementis the lastpopBack()VoidPublicThis function is toremoves the last elementin the vector. Reducingthe list size by oneThis function will reducethe size of the listeffectivelyisEmpty() constbooleanPublicThis function is to testwhether the vector isemptyNeeded function foranother functions such asresize function and so on.isFull() constBooleanPublicThis function is to checkwhether the vector is fullNeeded function foranother functions such asresize function.getNumberOfElement() constintPublicThis function is toreturns number ofelements in the vectorNeeded function foranother functions such asresize function.getCapacity()constIntPublicThis function is to returnthe size of the storagespace currently allocatedfor the vector.

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 20 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
One
Professor
N/A
Tags
Solar System, weather

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture