Question: ***LANGUAGE IS SCHEME (RACKET R5RS)*** 2. Define a SCHEME function named make-clock which takes two parameters which represent the current time in inutes only. Your


***LANGUAGE IS SCHEME (RACKET R5RS)***
2. Define a SCHEME function named make-clock which takes two parameters which represent the current time in inutes only. Your clock object should and minutes. Your clock object should store the current time in m expose three functions for working with the clock object: . 'tick - advances the time of the clock object by one minute time-displays the current 12-hour time indicating whether the current time is AM or PM . 'military - displays the current time in military (24-hour) time >(define get-time (clock 'time)) >(define get-mil (clock 'military)) > (get-time) ((clock 'tick)) >(get-time) ((clock 'tick)) >(get-time) >(get-mil) 9:00 PM 9:01 PM 9:02 PM 21:02 Note: If the time is displayed in military time, your object should print any leading zeros for the hour. Both time formats should print leading zeroes for the minutes. For example 2. Define a SCHEME function named make-clock which takes two parameters which represent the current time in inutes only. Your clock object should and minutes. Your clock object should store the current time in m expose three functions for working with the clock object: . 'tick - advances the time of the clock object by one minute time-displays the current 12-hour time indicating whether the current time is AM or PM . 'military - displays the current time in military (24-hour) time >(define get-time (clock 'time)) >(define get-mil (clock 'military)) > (get-time) ((clock 'tick)) >(get-time) ((clock 'tick)) >(get-time) >(get-mil) 9:00 PM 9:01 PM 9:02 PM 21:02 Note: If the time is displayed in military time, your object should print any leading zeros for the hour. Both time formats should print leading zeroes for the minutes. For example
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
