Part 13. Interval Data Definition
We use intervals to define information where it has a specific range.Here is the Example Problem: Imagine that you will make a data definition for the seat number in a row on a certain theater. There are 32 seats in a row.
If you have been in some arena or gymnasium. You know that the seats are horizontal in nature. There are seat numbers from 1 to 32. That is the information that we can get from the problem domain.
In our type definition, we declare the seat number as SeatNum and it is an integer between 1 and 32. Square brackets are inclusive and parenthesis are exclusive. Just like the number line in elementary math.
Next, the interpretation of the data.
We need to be specific with our interpretations of the data. We have to determine what these kinds of seats are.
Now for the examples
Finally, the template, we derive the template from the HtDD recipe. We also need to specify what data we used.
And we are done with the data definition that we can use as a guide on how to design the function itself.
Mga Komento
Mag-post ng isang Komento