Question: (a) Design a type called Point3D in RSL to model a 3D point with coordinates x,y, and z of types integer. (b) Design a function

(a) Design a type called Point3D in RSL to model a 3D point with coordinates x,y, and z of types integer.

(b) Design a function called moveX that takes a point p and an integer value d and moves the point along its x axis adding d to its x. The function should make sure in its precondition that d is not a negative integer. Use RSL pre to write the precondition.

(c) Design a function called move Diagonal that takes a point p and an integer value d and moves the point diagonally by moving it along all axes x,y, and z by adding d to its x,y, and z. The function should make sure in its postcondition that x,y and z coordinates of p are increased by d after the move. Use RSL post to write the postcondition.

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!