#lang racket
(require csc151)
(require rackunit)
(require rackunit/text-ui)

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

;;; Total time: (required for extra credit!)

;; +---------+--------------------------------------------------------
;; | 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:

;;     Errors:
;;      Times:
;;   Prologue:
;;   Epilogue:
;;Cover Sheet:
;;           :
;;           :
;;           ----
;;      Total:

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

; Time Log:
;   Date        Start   Finish  Elapsed Activity

; Time Spent: 

; Citations:

; Solution:

; a.

;;; Procedure:
;;;   encrypt-a-char
;;; Parameters:
;;;   
;;; Purpose:
;;;   
;;; Produces:
;;;   
;;; Preconditions:
;;;   
;;; Postconditions:
;;;   

; b.
(define encrypt-a-char-b
  (lambda (x) x)) ; STUB

; c.
(define encrypt-a-char-c
  (lambda (x) x)) ; STUB

; d.
(define encrypt-a-char-d
  (lambda (x) x)) ; STUB

; Examples/Tests:
#|

|#

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

; Time Log:
;   Date        Start   Finish  Elapsed Activity

; Time Spent: 

; Citations:

; a.

;;; Procedure:
;;;   count-frequency
;;; Parameters:
;;;   
;;; Purpose:
;;;   
;;; Produces:
;;;   
;;; Preconditions:
;;;   
;;; Postconditions:
;;;   

; b.
; Provided Code:
(define count-frequency
  (lambda (str chr)
    (length (filter (section equal? <> chr) (string->list str)))))

; Solution:
(define tests-count-frequency
  (test-suite
   "Tests of the count-frequency procedure"
   (test-case
    "short strings-unique-characters"
    (check-equal? (count-frequency "str" #\s) 1))
   (test-case
    "short strings-repeated-characters"
    (check-equal? (count-frequency "csc" #\c) 2))
   (test-case
    "longer strings"
    (check-equal? (count-frequency "alphaalpha" #\a) 4))
))

; Examples/Tests:
#|
> (run-tests tests-count-frequency)

|#

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

; Time Log:
;   Date        Start   Finish  Elapsed Activity

; Time Spent: 

; Citations:

; Solution:

;a.

;;; Procedure:
;;;   string-starts-with?
;;; Parameters:
;;;
;;; Purpose:
;;;   
;;; Produces:
;;;   
;;; Preconditions:
;;;   
;;; Postconditions:
;;;   

(define string-starts-with?
  (lambda (x) x) ;STUB	

; b.

;;; Procedure:
;;;   modified-average-length
;;; Parameters:
;;;
;;; Purpose:
;;;   
;;; Produces:
;;;   
;;; Preconditions:
;;;   
;;; Postconditions:
;;;   

(define modified-average-length
  (lambda (x) x) ;STUB	

; Examples/Tests:

#|

|#

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

; Time Log:
;   Date        Start   Finish  Elapsed Activity

; Time Spent: 

; Citations:

; Solution:

; a.
;;; Procedure:
;;;   adjust-courses
;;; Parameters:
;;;
;;; Purpose:
;;;   
;;; Produces:
;;;   
;;; Preconditions:
;;;   
;;; Postconditions:
;;;   
(define adjust-courses
  (lambda (x) 
    x)) ; STUB

; b.
;;; Procedure:
;;;   adjust-courses-reverse
;;; Parameters:
;;;
;;; Purpose:
;;;   
;;; Produces:
;;;   
;;; Preconditions:
;;;   
;;; Postconditions:
;;;   
(define adjust-courses-reverse
  (lambda (x) 
    x)) ; STUB

; Examples/Tests:
#|

|#

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

; Time Log:
;   Date        Start   Finish  Elapsed Activity

; Time Spent: 

; Citations:

; Data:

; Solution:

;;; Procedure:
;;;   highest-hp
;;; Parameters:
;;;
;;; Purpose:
;;;   
;;; Produces:
;;;   
;;; Preconditions:
;;;   
;;; Postconditions:
;;;   
(define highest-hp
  (lambda (x)
    x)) ; STUB

; Examples/Tests:
#|

|#

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

; Time Log:
;   Date        Start   Finish  Elapsed Activity

; Time Spent: 

; Citations:

; Solution:

;;; Procedure:
;;;   most-common-primary-types
;;; Parameters:
;;;
;;; Purpose:
;;;   
;;; Produces:
;;;   
;;; Preconditions:
;;;   
;;; Postconditions:
;;;   
(define most-common-primary-types
  (lambda (x)
    x)) ; STUB

; Examples/Tests:
#|

|#
