CS计算机代考程序代写 DrRacket ;; The first three lines of this file were inserted by DrRacket. They record metadata

;; The first three lines of this file were inserted by DrRacket. They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib “htdp-beginner-reader.ss” “lang”)((modname hw4) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Problem 1

;; Consider the following structure definitions:

(define-struct guitar [brand-name color electric?])
(define-struct drum-kit [brand-name electric?])
(define-struct saxophone [brand-name])
(define-struct piano [brand-name])

;; Part A

;; Design four data types called Guitar, DrumKit, Saxophone, and Piano: one for
;; each structure. Ensure you complete all steps of the data design recipe for
;; all four data types.

;; [TODO] Four complete data designs

;; Part B

;; Design a data type called Instrument, which can represent any one of the
;; four instruments defined above.

;; [TODO] Data design recipe

;; Part C

;; Design a data type called Band, which may have 1, 2, or 3 instruments.
;; The Band data type should hold information about all the instruments in
;; the band.

;; [TODO] Data design recipe

;; Part D

;; Design a function that takes a band and produces another band that is
;; identical, except that all guitars and drums become electric!

;; [TODO] Function design