Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please look closely at the numbers: donot copy from other posts they have different numbers. Please use DR Racket and screen shot input and output.

Please look closely at the numbers: donot copy from other posts they have different numbers. Please use DR Racket and screen shot input and output. Thanks

In the beginning of each part of this problem, introduce a named value sqr3, which is 1.732. You will have to write a function my_calc that takes two numerical parameters. If the first parameter is 1, calculate the area of an equilateral triangle, whose side equals the second parameter of the function. If the first parameter is 2, calculate the area of the hexagon, whose side equals the second parameter of the function. For other values of the first parameter and for a non-positive second parameter return a false Boolean value.

(a) [10 points] Implement a function my_calc using a multiple-way selection structure when checking the value of the first parameter.

(b) [10 points] Implement a function my_calc using a two-way selection structure when checking the value of the first parameter.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions