210k views
4 votes
Define a LISP function named AREATRIANGLE that accepts the base and height as parameters and returns the area.

A. (defun AREATRIANGLE (base height) (* 0.5 base height))
B. (function AREATRIANGLE (base height) (/ (* base height) 2))
C. (define AREATRIANGLE (base height) (* 0.5 base height))
D. (LISP-function AREATRIANGLE (base height) (* base height 0.5))

User Wallybh
by
7.6k points

1 Answer

3 votes

Final answer:

The correct option for the LISP function named AREATRIANGLE is A. (defun AREATRIANGLE (base height) (* 0.5 base height)).

Step-by-step explanation:

The correct option for the LISP function named AREATRIANGLE is A. (defun AREATRIANGLE (base height) (* 0.5 base height)). This function takes the base and height as parameters and returns the area of the triangle. The formula for calculating the area of a triangle is 1/2 times the base times the height.

User Tom Cruise
by
7.6k points