;; The first three lines of this file were inserted by DrScheme. 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 lab3-1b) (read-case-sensitive #t) (teachpacks ((lib "world.ss" "teachpack" "htdp") (lib "testing.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "world.ss" "teachpack" "htdp") (lib "testing.ss" "teachpack" "htdp"))))) ;; lab3-1b.ss ;; Each of the following pieces of information represents a file in ;; a computer directory. Design the Scheme data definitions necessary to ;; represent the information related to {\em{picture files}} and ;; convert the information into Scheme data. ;; ;; Picture of a river (jpeg) that is 3456 pixels wide and 2304 ;; pixels high, using up 3,614,571 bytes. ;; ;; Picture of a mountain (jpeg) that is 2448 pixels wide and 3264 ;; pixels high, using up 1,276,114 bytes. ;; ;; Picture of a group of people (gif) that is 545 pixels wide and 641 ;; pixels high, using up 13,760 bytes. ;; ;; Picture of a plt icon (bmp) that is 16 pixels wide and 16 ;; pixels high, using up 1334 bytes. ;; A Picture is (make-pic String Number Number Number String) (define-struct photo (name width height bytes kind)) (define river (make-photo "River" 3456 2304 3614571 "jpeg")) (define mountain (make-photo "Mountain" 2448 3264 1276114 "jpeg")) (define people (make-photo "People" 545 641 13760 "gif")) (define plt-icon (make-photo "PLT icon" 16 16 1334 "bmp"))