Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 1 out of 2 pages
Exam (elaborations)

CPSC 110 Midterm 1 with Complete Solutions

Document preview thumbnail
Preview 1 out of 2 pages

CPSC 110 Midterm 1 with Complete Solutions

Content preview

CPSC 110 Midterm 1 with Complete Solutions
What are the examples for an Enumeration Data Definition? - ANSWER-;;<examples
are redundant for enumerations>

What are the template rules for an atomic non-distinct Data Definition? -
ANSWER-;;Template rules used:
;; -atomic non-distinct

What are the template rules for an Interval Data Definition that includes numbers 1-100?
- ANSWER-;;Template rules used:
;; - atomic non-distinct: Natural[1,100]

What are the template rules used for an Enumeration Data Definition for Names that
include Amelia, Briana, Alma and Charlotte? - ANSWER-;;Template rules used:
;; -one of: 3 cases
;; -atomic distinct value: "Amelia"
;; -atomic distinct value: "Briana"
;; -atomic distinct value: "Alma"
;; -atomic distinct value: "Chelsea"

What are the template rules used for an itemization Data Definition where TrafficLight is
either false, red, yellow or green? - ANSWER-;;Template rules used:
;; -one of: 4 cases
;; -atomic distinct: false
;; -atomic distinct: "red"
;; -atomic distinct: "yellow"
;; -atomic distinct: "green"

What comes after the Interpretation in a Data Definition? - ANSWER-Examples

What comes after the type comment in a Data Definition? - ANSWER-Interpretation

What is the template for an atomic non-distinct data definition for StreetName? -
ANSWER-(define (fn-for-street-name sn)
(... sn))

What is the template for an Enumeration Data Definition for Names that include Amelia,
Briana, Alma and Charlotte? - ANSWER-(define (fn-for-names n)
[(string=? n "Amelia") (...)]
[(string=? n "Briana") (...)]
[(string=? n "Alma") (...)]
[(string=? n "Charlotte") (...)]

What is the template for an itemization Data Definition where TrafficLight is either false,
red, yellow or green? - ANSWER-(define (fn-for-traffic-light tl)

Document information

Uploaded on
March 5, 2025
Number of pages
2
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$9.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
CLOUND
3.9
(128)
Sold
655
Followers
389
Items
12042
Last sold
1 week ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions