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
Get step-by-step solutions from verified subject matter experts
