Question
Given a description of a method, write up a formal specification describing input parameters and the relation between input and output of the method together
Given a description of a method, write up a formal specification describing input parameters and the relation between input and output of the method together with the method signature. Questions: A class for drawing 2D geometric shapes provides two services to draw circles and rectangles. To draw a circle, one non-null point and a radius are provided to the draw method. The method confirms successful completion of painting the required circle by returning a string formatted as follows: Circle: center (x, y), radius = n. The class also provides a draw method for drawing a rectangle from two points: top-left corner and bottom-right corner. Also, both shapes allow clients to calculate their area and perimeter. Notice that a point is a class (Point) that store two coordinates (x and y) and allows through a constructor to set values for these coordinates. Once the coordinates values have been set, they cannot be changed from within a point object or by an external client. Task 7.1: Create a folder on your machine and name it IDTask7.1 1. Initialize this folder as a Git repository. 2. Define an abstract class Shape and extend it by two concrete classes: a Circle and a Rectangle. Store all files in the folder IDTask7.1 3. Compile your classes and demo that they work. 4. Based on the description above, write four specifications: one for each method of the two shapes. 5. Add all the specification to the source files, each atop its method, using Java standard annotation.
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