;; 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 review) (read-case-sensitive #t) (teachpacks ((lib "draw.ss" "teachpack" "htdp") (lib "hangman.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "draw.ss" "teachpack" "htdp") (lib "hangman.ss" "teachpack" "htdp"))))) ;; is this a correct definition? (define (x y z) (* y (+ z 5))) ;; if yes, what will be printed? (x 2 3) ;; Write 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 ;; 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. ;; Write a function that takes four letter-grades ;; and computes GPA for the semester ;; Use the function that you wrote for the previous question. ;; Write a function on-deans-list? that takes four letter-grades ;; and returns true if the student's GPA is 3.5 or above and ;; false otherwise ;; define a structure card that has a suit (a symbol 'Spades, 'Hearts, ;; 'Diamnods, 'Clubs) and a value 2, 3, .., 10, 11 (J), 12 (Q), 13 (K), ;; 14 (A) ;; write a function "match?" that takes two cards and returns true if they have ;; the same suit or value, false otherwise ;; write 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. ;; 'InAcademicTrouble if ;; the GPA is < 2.0, 'MapEligible if GPA >= 3.0 and ;; 'DeansList if GPA is >= 3.5. ;; The highest result is returned. ;; Will the condition ;; work as intended? ;; 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] ) ) ;; change the function if needed; ;; add a check for errors for invalid data ;;(How-good-is-GPA? -10)