From brand guide: https://flsouthern.mediavalet.com/portals/fsc-brand-guidelines
CSC 4640: Programming Languages
(Spring 2025)

Syllabus

LMS

Teachers


Assignments


Other Pages

Project 2:
My car makes a long Racket


Assigned: Fri Jan 17 2025
Due: 11:59:00 PM on Tue Feb 04 2025
Team Size: 1
Language: Racket
Out of: 56 points


In this project, you will write some more Racket procedures using your newfound powers of conditionals and list-creation.

Part 0, 0 points:

Create a file named project2.rkt and put the racket header and a comment with your name at the top. All of your procedure definitions will go in that file.

Part 1, 10 points:

Exercise 8.5.1: append-element. Here we go! If you like python's .append method, this is the most similar thing to that. There are some examples in the packet.

Part 2, 8 points:

Exercise 8.5.2. To do this one, you're going to define eight different procedures to create each of the values. (E.g. (five-two-a) will return the first value. It would be too easy for you to just plug in the actual value, so I'm going to feed in different values than the ones listed in the packet. Thus, you'll first need to read values in four times for each of the four things defined here:
(define colors (read))
(define numbers (read))
(define nested-list (read))
(define four (read))
Then define your eight procedures that are restricted to the procedures and values listed. These are procedures with zero arguments, so the first one will start like this:
(define (five-two-a)
  (...

Part 3, 10 points:

Exercise 8.5.3: percentage-bounds. Here's an example in addition to the one in the book:
> (percentage-bounds 80 10)
(72 88)

Part 4, 8 points:

Exercise 8.5.4. Just like 8.5.2, you're going to define a bunch of functions that use the four values. (You don't need to read them in again because you already did that.) Note: you should only use the length procedure on the last one.

Part 5, 10 points:

Exercise 8.5.5: swap-first-last. There are examples in the packet, but let me add some edge cases you might not be considering:
> (swap-first-last '())
()
> (swap-first-last '(1))
(1)

Part 6, 10 points:

Exercise 8.5.6: reverse-middle. There are examples in the packet, but I will also be testing the edge cases here.

Part 7, 0 points:

In order to make your procedures readable by other files, you need to tell the code that they are available to be used by using the provide procedure. In order to make everything available, add this line to the end of your file:
(provide (all-defined-out))

Submitting your Project: Choose a team name consisting of alphabetical characters. Put your file in a folder named <teamName>Project2, zip up the folder, and upload it to Canvas. Please make sure you name your folder correctly first, then zip it up, not the other way around. (You will have to resubmit if you don't do this.) If you submit early enough, let me know so I can test your code and give you a score. If you submit after the deadline please let me know right away so I can give you a grade.