#lang racket
(require csc151)
(require plot)

;;; File:
;;;   000000.rkt
;;; Authors:
;;;   The student currently referred to as 000000
;;;   Nicole Eikmeier
;;;   Fahmida Hamid
;;;   Anya Vostinar
;;; Contents:
;;;   Code and solutions for Exam 2 2020S
;;; Citations:
;;;

;; +---------+--------------------------------------------------------
;; | Grading |
;; +---------+

;; This section is for the grader's use. Please do not remove it.

;; Problem 1: 
;; Problem 2:
;; Problem 3:
;; Problem 4:
;; Problem 5:
;; Problem 6:
;;           ----
;;     Total:

;;      Times:
;;          :
;;          :
;;          :
;;           ----
;;     Total:

;; +-----------+------------------------------------------------------
;; | Problem 1 |
;; +-----------+

; Time Log:
;   Date        Start   Finish   Elapsed   Activity

; Time Spent: 

; Citations:

; Solution:

;;; Procedure:
;;;   list-contains?
;;; Parameters:
;;;   
;;; Purpose:
;;;   
;;; Produces:
;;;   
;;; Preconditions:
;;;   
;;; Postconditions:
;;;   

(define list-contains
  (lambda (x y)
    x)) ;STUB

; Examples/Tests:
#|

|#

;; +-----------+------------------------------------------------------
;; | Problem 2 |
;; +-----------+

; Time Log:
;   Date        Start   Finish   Elapsed   Activity

; Time Spent: 

; Citations:

; Solution:

; a.
;;; Procedure:
;;;   remove-item
;;; Parameters:
;;;   
;;; Purpose:
;;;   
;;; Produces:
;;;   
(define remove-item
  (lambda (x y)
    x)) ; STUB

; b.
;;; Procedure:
;;;   sublist?
;;; Parameters:
;;;   
;;; Purpose:
;;;   
;;; Produces:
;;;   
;;; Preconditions:
;;;   
;;; Postconditions:
;;;   
(define find-sublist
  (lambda (x y)
    x)) ; STUB

; Examples/Tests:
#|

|#

;; +-----------+------------------------------------------------------
;; | Problem 3 |
;; +-----------+

; Time Log:
;   Date        Start   Finish   Elapsed   Activity

; Time Spent: 

; Citations:

; Solution:

; Complete parts a and b below. You only need to show the cleaned-up and
; reformatted procedure once.

;; Procedure:
;;;   
;;; Parameters:
;;;   
;;; Purpose:
;;;   
;;; Produces:
;;;   
;;; Preconditions:
;;;   
;;; Postconditions:
;;;   
(define list-ref (lambda (char make-list) (let ([string 

(if (not (null? char)) (car char) null)])(cond [

(empty? string) null] [else (let* ([and 

(car string)][or  (cadr string)][not 

(caddr string)][predicate? (* 

and not)]) (sort (cons (

list or predicate?) 

(list-ref (cdr char) 

make-list))(lambda

(string char)(

make-list (cadr 

string) (cadr 

char))

)))]

)))

)

; c. Explain how this procedure achieves its purpose.



; Examples/Tests:

#|

|#

;; +-----------+------------------------------------------------------
;; | Problem 4 |
;; +-----------+

; Time Log:
;   Date        Start   Finish   Elapsed   Activity

; Time Spent: 

; Citations:

; Solution:

;; Procedure:
;;;   items-in-order?
;;; Parameters:
;;;   
;;; Purpose:
;;;   
;;; Produces:
;;;   
;;; Preconditions:
;;;   
;;; Postconditions:
;;;

(define items-in-order?
  (lambda (x y)
    x)) ;STUB

; Examples/Tests:
#|

|#

;; +-----------+------------------------------------------------------
;; | Problem 5 |
;; +-----------+

; Time Log:
;   Date        Start   Finish   Elapsed   Activity

; Time Spent: 

; Citations:

; Provided Code:

(define highest-hp-kernel
  (lambda (lst)
    (let ([higher-hp (lambda (poke1 poke2)
                       (> (list-ref poke1 5) (list-ref poke2 5)))]
          [nice-name (lambda (poke)
                       (list (cadr poke) (list-ref poke 5)))])
      (map nice-name (take (sort lst higher-hp) 5)))))

; Solution:
 
(define highest-hp
  (lambda (x)
    x)) ; STUB

; Examples/Tests:
#|

|#

;; +-----------+------------------------------------------------------
;; | Problem 6 |
;; +-----------+

; Time Log:
;   Date        Start   Finish   Elapsed   Activity

; Time Spent: 

; Citations:

; Solution:

;; Procedure:
;;;   types
;;; Parameters:
;;;   
;;; Purpose:
;;;   
;;; Produces:
;;;   
;;; Preconditions:
;;;   
;;; Postconditions:
;;;

(define types
  (lambda (x)
    (parameterize ([plot-x-tick-label-anchor  'top-left]
                 [plot-x-tick-label-angle   -40])
  (plot (discrete-histogram x))))) ;STUB

; Histogram for full Pokemon data set here:
#|




|#

; Examples/Tests:
#|

|#