[plt-scheme] Scheme grade calculator
On Apr 26, 2010, at 6:44 PM, Joe Burk wrote:
> Does anyone know of a grade calculator written in scheme. I'm particularly looking for one that would include the assignments name, the total points the assignment is worth, and the weight of the assignment.
>
> For example I'm looking for something that could do this:
>
> (define assignment (make-assignment "Test #1" 30 10))
>
> (assignment-name assignment) = "Test #1"
> (assignment-out-of assignment) = 30
> (assignment-weight assignment) = 10
> (assignment? assignment) = #t
>
Do you mean this:
(define-struct assignment (name out-of weight))
(define assignment1 (make-assignment "Test #1" 30 10))
(assignment-name assignment1) = "Test #1"
(assignment-out-of assignment1) = 30
(assignment-weight assignment1) = 10
(assignment? assignment1) = #t
It works exactly along the lines you asked for.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100426/b9851443/attachment.html>