Assignment 0 ------ This is a **solo, Gradescope assignment**—you will submit two individual submissions on Gradescope, one with written answers and one with code. ### Change log I will avoid making changes to the assignment after it is posted, but any necessary changes will be added here: # Written Questions :::success Fill in and submit the `Assignment 0: Written responses` on Gradescope. ::: # Code submission :::success Install Racket via the instructions at this link: https://download.racket-lang.org Be sure to install version 8.14 or later. ::: Open the DrRacket application, which is the default IDE ("integrated development environment") for Racket. Note that the following question can be attempted prior to Monday's class, but will make more sense after it. Also note that Q3 is essentially warmup problems to get you familiar with the IDE. Future programming assignments will be substantially more difficult. :::success Create a file named `a0.rkt` for your code. For this assignment, your Racket file should start with the line `#lang racket`. ::: Note that most assignments in this class (including this one) will use Github's autograder features. This means you will get feedback on some aspects of the correctness of course code, when you submit it. This automated system relies on precise naming conventions for your files and functions. If the autograder is successful, you will see the following: ``` All autograder tests passed, nice work! ``` Please let me know if you are unable to solve any issues with the autograder feedback on your own! :::info You should write Racket solutions using primarily the operators and functions we have seen so far in class. Do not use Racket library functions that accomplish the full task, even if they exist. ::: # Coding problem 1: `repeat-element` Write a Racket function, `repeat-element`, that repeats every element in a list twice. For example: ```racket > (repeat-element (list 1 2 3)) '(1 1 2 2 3 3) ``` # Coding problem 2: `is-sorted?` Write a Racket function, `is-sorted?`, that checks whether a list is sorted. `is-sorted?` should return true if the list is a sorted list of strings or a sorted list of numbers, but false if the elements are not in order or if the list contains heterogenous datatypes. Beyond what we saw in class, you may find the following Racket functions useful: - `string?`, `number?`: check whether a value is a string or a number, respectively. - `string<?`, `string<=?`: [documentation](https://docs.racket-lang.org/reference/strings.html#%28def._%28%28quote._~23~25kernel%29._string~3c~3f%29%29) For example: ```racket > (is-sorted? (list 1 2 2 3)) #t > (is-sorted? (list "a" "c")) #t > (is-sorted? (list "c" "a")) #f > (is-sorted? (list "a" "2")) #f ``` # Grading This assignment is worth 50 points, broken down by: :::info - 14: Written response 1 - 4 : Written response 2 - 6 : Written response 3 - 10: Written response 4 - 6 : Coding problem 1 - 10: Coding problem 2 ::: # Submission Submit the following files on Gradescope: :::success To `Assignment 0: Code` - `a1.rkt` To `Assignment 0: Written responses` - (Complete the answers on Gradescope) :::