When writing my code in Scheme, the error of
application: not a procedure;
expected a procedure that can be applied to arguments
given: 1
appears. I am supposed to use Heron's formula to calculate the formula of the area of a triangle.
Here is my code:
(define (s a b c)
(/ (+ a b c) 2))
(define (area a b c)
((sqrt (*(- (s a b c)(a))
(-(s a b c)(b))
(-(s a b c)(c)))
)))
Again the output is:
application: not a procedure;
expected a procedure that can be applied to arguments
given: 1
arguments...: [none]