{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Module 3 -Cs 115

# Module 3 -Cs 115 - MO D U LE 3 N EW TYPES OF DATA Data type...

This preview shows pages 1–3. Sign up to view the full content.

MODULE 3: NEW TYPES OF DATA Data type: Boolean A Boolean value is either true or false A Boolean function produces a Boolean value Comparisons: function that consumes 2 numbers -> Boolean value (= x y) => whether x = y is true or false (< x y) => whether x < y (> x y ) => whether x is greater than y (<= x y) => whether x is less than or equal to y (>= x y) => whether x is greater than or equal to y Also, string=? and string<? Ie. (string=? “this” “this”) true (string=? “This” “this”) false and & or can have 2 or more arguments and => true; exactly when all of its arguments are true or => true; at least one of its arguments are true not => true; exactly when its one argument is false Substitution Rules for and (and true exp….) => (and exp ….) (and false exp…) => false (and) => true when all arguments evaluate true

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Substitution Rules for or (or true exp …) => true (or false exp …) => (or exp …) (or) => false Predicate: a Boolean function that determines if data is of a particular form Built-in : even? negative? zero? string?
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

Module 3 -Cs 115 - MO D U LE 3 N EW TYPES OF DATA Data type...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online