;; EXERCISE GOAL: to develop programs to show grades as a bar graph ;; USEFUL CONSTANTS (define GRADE-WIDTH 20) (define GRADE-HEIGHT 10) (define PICTURE-WIDTH 125) (define PICTURE-HEIGHT 100) ;; 1. Provide a data definition for list-of-image ;; 2. Write a function compose-images that consumes a list of images ;; and produces an image. The produced image is the combination of ;; all the images in the input list (hint: use image+ (207) or overlay/xy (208)) ;; 3. Write a program count-grades that consumes a symbol (a letter ;; grade) and a list of symbols (letter grades) and produces the number ;; of times the given grade appears in the list. ;; 4a. Write a program grade-to-bar that consumes a number of grades ;; and a bar color, and produces a rectangle whose height is ;; proportional to the number of grades, or an empty image if there ;; are no grades. Use the constants provided. ;; 4b. Write a program grade-bar-image that consumes a letter grade, bar ;; color, x-coordinate for the bar and a gradelist and produces an ;; image. The image should be of a bar whose height is proportional ;; to the number of times the grade appears in the list. Use the ;; constants provided. (hint: do this first with the bar growing ;; downwards in the image, then refine your function to draw the bar ;; growing upwards) ;; 5. Write a program grades-to-bars that consumes a list of symbols ;; (a list of grades) and produces a list of 3 images. The first is a ;; red bar at x coordinate 25 for the A grades, the second a ;; blue bar at x coordinate 50 for the B grades, the second a ;; green bar at x coordinate 75 for the C grades. ;; 6. Write a program graph-grades that consumes a list of grades and ;; produces an image of the bar graph for the grades. ;; SUPER-CHALLENGE : Redo this exercise to animate the graph ;; construction as you process the grades