Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

To monitor enrollments each semester, I have a spreadsheet that contains a list of courses with names, enrollments, and capacities. I read the spreadsheet data

To monitor enrollments each semester, I have a spreadsheet that contains a list of courses with names, enrollments, and capacities. I read the spreadsheet data into a Racket list that looks like this:
'(("Dept" "Number" "Section" "Class Nbr" "Capacity" "Enrolled")
("CS""1000""1""11546""30""30")
("CS""1025""1""11547""30""30")
("CS""1120""1""11557""30""15")
("CS""1130""1""11548""30""18")
...)
The first item in the list is the header row in the spreadsheet. It is not part of the data.
The dean and provost frequently ask me for various summary data, such as total enrollments or remaining capacity.
Write a Racket function named min-open-seats that takes such as a list as its only argument. It returns the minimum number of open seats available in any section. For example:
>(define example '(...)) ; the data shown above
>(min-open-seats example)
0
CS 1025 has 30-30=0 open seats. The other classes have 0,15, and 12 open seats respectively.
I have provided a check-equal? expression for this example. Write at least two more check-equal? expressions to test your solution.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions