Question: 1 . Assuming that complex is a record ( class ) with two fields, re and im , write the body of a task with

1.Assuming that complex is a record (class) with two fields, re and im, write the body of a task with the
following specification:
task buildComplex is
entry putReal (x : in real);
entry putImaginary (x : in real);
entry getcomplex (x : out complex);
end buildComplex;
Inside a loop, the task alternately puts together a complex number from calls to putReal and put Imaginary,
and then returns the result through the call to getcomplex.
2.Rewrite the body of the buildComplex task so that it accepts calls to putReal and put Imaginary in any
order (use a select statement).
 1.Assuming that complex is a record (class) with two fields, re

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!