I am new to scheme, and are learning it using Dr.Scheme, please help
I came across this question, but have some trouble with it:
A clock structure (define-struct Clock(hours minutes seconds)). Make a function that Consume a Clock structure and output the total seconds
;;this is what i did
(define-struct Clock (hours minutes seconds))
(define Clock1(make-Clock 10 10 10))
(define (ChangeIntoSec ClockX)
(+ (+ (* (Clock-hours Clock1) 3600)
(* (Clock-minutes Clock1) 60))
(Clock-seconds Clock1)))
;;end
did I do it right? because is the user suppose to type in the hours, minutes and seconds themself in the interactive window? In my answer I made a clock myself, instead of asking the user to type in the time for the clock structure
please help
thanks in advance