Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How can you listen critically to others public speeches?

Answered: 1 week ago

Question

Differentiate 3sin(9x+2x)

Answered: 1 week ago

Question

5 The mechanics of the circular flow model.

Answered: 1 week ago

Question

1 The difference between a command system and a market system.

Answered: 1 week ago

Question

4 How the market system adjusts to change and promotes progress.

Answered: 1 week ago