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

Step: 3

blur-text-image

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

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

2. What are the prospects for these occupations?

Answered: 1 week ago

Question

1. How did you go about making your selection?

Answered: 1 week ago