Please enable JavaScript.
Coggle requires JavaScript to display documents.
(Systematic Programming) How to Code : Simple Data - Coggle Diagram
(Systematic Programming) How to Code : Simple Data
Beginning Student Programming Language (BSL)
How To Design
How To Design Data (HTDD)
The Recipe
1. Possible Structure Definition
2. Type Comment
3. Interpretation
5. A Template
4. Examples
6. Template Rules
Data Definitions
Interval
What is it ?
Number with a certain range
Body
: (... x)
Examples :
[0 , 10]
[0, 25)
Enumeration
What is it ?
when the information to be represented consists of a fixed number of distinct items.
<examples are redundant for enumerations>
Examples :
The color of the traffic light , light is one of :
"red"
Atomic Distinct Value
"yellow"
Atomic Distinct Value
"green"
Atomic Distinct Value
Body :
check if the parameter is one of the lights and put
else
statement if it is necessary
Simple Atomic Data
What is it ?
it is atomic non-distinct
Examples :
Number (any number not a specific one)
String (any word not a specific string)
Boolean
Image
Interval like Number [0, 10) (range of numbers)
Body
: (... x)
Itemization
What is it ?
data comprised of 2 or more subclasses, at least one of which is not a distinct item.
Examples :
is one of:
false
Atomic Distinct Value
Number
Non-distinct
Body :
check if the parameter(s) is one of the types of the data in examples and put
else
statement if it is necessary
Compound Data
What is it ?
use structures when two or more values naturally belong together.
Examples :
The x and y Position of the ball
(define-struct ball (x y))
(make-ball Number Number) a ball at x and y position
Body :
(... (ball-x b)
(ball-y b))
References to other defined type
self-referential or mutually referential
Types of Data
Atomic Distinct Value
Examples:
"Red", False, Empty
One of :
Enumerations, Itemization
Atomic Non-Distinct
Examples
Number, String, Boolean, Image, Intervals
How To Design Worlds (HTDW)
How To Design Functions (HTDF)
The Recipe
4. Code the function body
5. Test and Debug Until success
3. Inventory, Template, Constants
2. Examples
1. Signature, Purpose, Stub