xcode - how to create a uml class diagram from code -
i building calculator app , stuck on creating uml class diagram it. if have following class in project called calculatorbrain, how make uml class diagram out of code? appreciated.
#import "calculatorbrain.h" @implementation calculatorbrain -(void)updatecurrentnumber:(double)number { currentnumber = number; } -(void)updatecurrentoperation:(int)op { currentoperation = op; } -(double)performoperation:(int)operation { if (currentoperation == 0) { result = currentnumber; } else{ switch (currentoperation) { case 1: result = result * currentnumber; break; case 2: result = result / currentnumber; break; } } currentnumber = 0; if (operation == 0) result = 0; currentoperation = operation; return result; } -(double)otherfunctions:(int)number { double facreturn = 0; switch (number) { case 1: facreturn = pow(currentnumber, 2); break; case 2: facreturn = 1/currentnumber; break; } return facreturn; } -(double)performtrigoperation:(int)angle { double angleresult = currentnumber; switch (angle) { case 1: if (degorrad == 0 || degorrad == 2) { angleresult = (angleresult / 180) * 3.14159265; angleresult = sin(angleresult); } else { angleresult = sin(angleresult); } break; case 2: if (degorrad == 0 || degorrad == 2) { angleresult = (currentnumber/180)*3.14159265; angleresult = cos(angleresult); } else { angleresult = cos(angleresult); } break; } return angleresult; } -(void)updateunitofmeasurement:(int)unit { degorrad = unit; } -(double)returncurrentnumber { return currentnumber; } -(double)returncurrentoperation { return currentoperation; } @end
Comments
Post a Comment