Hello,
I am currently working on a Racket programming project and I'm encountering some issues with my code. I have been trying to create a program that calculates the total duration of a Free-Fall Tower attraction, considering various phases including ascent, pause, and free fall.
Code:
;; ---------------------------------------------------------
;; Define Helper Functions and Constants
;; ---------------------------------------------------------
;; Signature: overall-time : number number -> number
;; Purpose: Given a height (in meters) and ascent speed (in m/s), calculate the duration of ascent and descent (in seconds).
;; Examples:
;; [Add your own examples here]
;; Definition:
(define (overall-time height ascent-speed)
...) ;; [Add your code here]
;; Tests:
;; [Add your tests here]
;; ---------------------------------------------------------
Information Text for the code:
"After the end of the autumn fair, a family of showmen is considering expanding their ride with a so-called Free-Fall Tower. In this attraction, paying guests are securely seated on a platform that is initially driven vertically upward for a certain distance (height in meters) at a constant speed of a meters per second.
At the highest point, the motion pauses for five seconds to increase excitement. Then, a free fall is initiated, lasting exactly half of the height. During this phase, the acceleration due to gravity, g = 9.81 m/s^2, is in effect (air resistance can be neglected).
From this point, the platform is decelerated with the reverse acceleration of -g to come to a stop precisely at the end of the ride. Create a Racket program called 'overall-time' that calculates the total duration for a given height (in meters) and a given ascent speed (in m/s), representing the time it takes for the platform to travel from the beginning to the end of the ride."