;; Review questions help you review the material. They are *not* ;; sample questions for either in-class or takehome part of the test. ;; is this a correct definition? (define (x y z) (* y (+ z 5))) ;; if yes, what will be printed? (x 2 3) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Define a function that, given a number of hours h, minutes m, and ;; seconds s, computes the total number of seconds in the time ;; interval. ;; Example: given h = 10, m = 15, s = 20, the expected value is ;; 36920 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Contract: number -> symbol ;; Purpose: to determine how good a GPA is. The function returns symbols as ;; follows: ;; 'InAcademicTrouble if the GPA is < 2.0, ;; 'MapEligible if GPA >= 3.0 and ;; 'DeansList if GPA is >= 3.5. ;; you may assume that you are given a number (define (how-good-is-GPA? gpa) (cond [(< gpa 2.0) 'InAcademicTrouble] [(>= gpa 3.0) 'MapEligible] [(>= gpa 3.5) 'DeansList] ) ) ;; does the function work as intended? ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Write a function that converts letter grades into their ;; corresponding GPA contribution: A=4, B=3, C=2, D=1. ;; All other grades contribute 0. ;; Grades are represented by symbols: 'A, 'B, etc ;; For simplicity we assume no + or - grades. All letters are ;; upper-case. ;; Write a function that takes four letter-grades ;; and computes GPA for the semester ;; Use the function that you wrote for the previous question. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; define a structure card that has a suit (a symbol 'Spades, 'Hearts, ;; 'Diamnods, 'Clubs) and a numeric value 2, 3, .., 10, 11 (= J), ;; 12 (= Q), 13 (= K), 14 (= A) ;; define a function "match?" that takes two cards and returns true if they have ;; the same suit or the same value (or both), false otherwise ;; define an "isValidCard?" function that takes a card structure and ;; returns true if the card has a valid suit and a valid value and ;; false otherwise. Your function must not fail on any data.