Question: UML Sequence Diagram B: A Small ProgramSince these are your first sequence diagrams, this example will keep things simple. Draw a sequence diagram based on

UML Sequence Diagram B: A Small ProgramSince these are your first sequence diagrams, this example will keep things simple. Draw a sequence diagram based on the code that follows
class SeqDia1{
private static double hmmm(double x){ return x*3.14; }
private static double bar(double x, double y){ return x + hmmm(y); } private static double foo(double x, double y, double z){ double result = bar(x+z, x+y); return bar(result+y, y); }// main() is to simply demonstrate calling the above // should you want to compile and run this program public static final void main(String[] args){ System.out.println("Output: "+ foo(432.,-5,5432.12)); }}In particular you want three lifelines here: foo(), bar(), and hmmm()If one was discussing the operation sequence of foo() then foo() and bar() matter.In this case, you are to also draw this diagram with a lifeline for hmmm() as it matters (for this part of this assignment).Draw the synchronous "call" arrows modelled after the code above.i.e., don't draw a lifeline for main() or any arrows that call foo() from main(). Clearly some code calls foo()--this diagram is concerned what foo() does --not what the callers are doing with what foo() returns.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!