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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started