I need help with the implementation of the UML of the Rectangle class #operators Bool==(Rectangle) Bool >(Rectangle) Ostream& operator<(ostream&, Rectangle)
UML- you mean the unified modeling language labeling system to describe a class?
Yes. am having troubles with that @woodrow73
3 boxes, top box is the class name, 2nd box holds all field names, followed by a : with data types on the right side 3rd box holds the methods, with the parameters followed by a return type like so ------------------------------------ +Rectangle ------------ -length : int -width : int ------------ +calcArea(leng : int, wid : int) : int ------------------------------------- this uml diagram of a class called rectangle says that the class name is Rectangle, the fields are length & width, and they are both of the int data types-- and the method in this class is called calcArea, it accepts 2 int variables into the arguments. The parameter displays the variables, followed by the data type. If there are multiple parameters, they are separated by a comma. After the parenthesis, you specify the method's return type after another : like I did. Finally, you can tell by the +/- signs, about which of the class/fields/methods are public/private.. + = public && - = private. That is how I'm taught to write a UML, though there exist some variations on the design.. subtle differences I think.
Here I explain UML much more in depth; http://openstudy.com/study#/updates/546e3100e4b0ecc3214a19c3
Join our real-time social learning platform and learn together with your friends!