; Purpose: to decide which season ;Contract: findMonth : number (month) ---> String ;Examole: (check-expect (findMonth 0) 'invalid) (check-expect (findMonth 145) 'invalid) ;Header: ; (define...


please use this format:
;purpose:
;contract:
;example
;header:
;template:
;function:
;testing:


; Purpose: to decide which season<br>;Contract: findMonth : number (month) ---> String<br>;Examole:<br>(check-expect (findMonth 0) 'invalid)<br>(check-expect (findMonth 145) 'invalid)<br>;Header:<br>; (define (findMonth x) 'String)<br>;Template:<br>(define (findMonth x)<br>(cond<br>...x... 0) 'invalid)<br>12) 'invalid)<br>((<=<br>((><br>..X. ...<br>( (and (>= ...x... 3) (<= ...x... 5)) 'spring)<br>( (and (>= ...x... 6) (<= ...x... 8)) 'summer)<br>( (and (>= ...x..<br>9) (<= ...x... 11)) 'fall)<br>(else 'winter)))<br>; Function:<br>(define (findMonth x)<br>(cond<br>((<= x 0)<br>( (> x 12) 'invalid)<br>( (and (>= x 3) (<= x 5)) 'spring)<br>( (and (>= x 6) (<= x 8)) 'summer)<br>( (and (>= x 9) (<= x 11)) 'fall)<br>'invalid)<br>(else 'winter))<br>;Test:<br>(findMonth 4)<br>(findMonth 14)<br>

Extracted text: ; Purpose: to decide which season ;Contract: findMonth : number (month) ---> String ;Examole: (check-expect (findMonth 0) 'invalid) (check-expect (findMonth 145) 'invalid) ;Header: ; (define (findMonth x) 'String) ;Template: (define (findMonth x) (cond ...x... 0) 'invalid) 12) 'invalid) ((<= ((=""> ..X. ... ( (and (>= ...x... 3) (<= ...x...="" 5))="" 'spring)="" (="" (and="" (="">= ...x... 6) (<= ...x...="" 8))="" 'summer)="" (="" (and="" (="">= ...x.. 9) (<= ...x...="" 11))="" 'fall)="" (else="" 'winter)))="" ;="" function:="" (define="" (findmonth="" x)="" (cond=""><= x="" 0)="" (="" (=""> x 12) 'invalid) ( (and (>= x 3) (<= x="" 5))="" 'spring)="" (="" (and="" (="">= x 6) (<= x="" 8))="" 'summer)="" (="" (and="" (="">= x 9) (<= x="" 11))="" 'fall)="" 'invalid)="" (else="" 'winter))="" ;test:="" (findmonth="" 4)="" (findmonth="">
1.<br>Design and instantiate a structure which has 2 fields: color (line color), positions<br>(positions of a line). color is represented by a string and positions is represented by a list which<br>has only 2 elements. Each element is a posn structure with 2 fields: x (x coordinate) and y (y<br>coordinate). x and y are represented by numbers. (Do not forget to write down the functions -<br>constructors, selectors, and predicates. Solve Question 2,3 by using that structure)<br>Distance of two points A(x,,y,) and B(x2,y½) is given by:<br>distance(A,B) = v(x,-x,}+(y,-y,}<br>

Extracted text: 1. Design and instantiate a structure which has 2 fields: color (line color), positions (positions of a line). color is represented by a string and positions is represented by a list which has only 2 elements. Each element is a posn structure with 2 fields: x (x coordinate) and y (y coordinate). x and y are represented by numbers. (Do not forget to write down the functions - constructors, selectors, and predicates. Solve Question 2,3 by using that structure) Distance of two points A(x,,y,) and B(x2,y½) is given by: distance(A,B) = v(x,-x,}+(y,-y,}

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here