Sign in to follow this  

T__T please help on scheme

Recommended Posts

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

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this