Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Note that for this project you are NOT allowed to use standard Racket functions, except functions that have been discussed in video lectures and

Note that for this project you are NOT allowed to use standard Racket functions, except functions that have

Note that for this project you are NOT allowed to use standard Racket functions, except functions that have been discussed in video lectures and in the textbook. Run each of the programs as many times as necessary to show that different situations are handled properly. 1. n 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) [12 points] Implement a function my_calc using a multiple-way selection structure when checking the value of the first parameter. (b) [13 points] Implement a function my_calc using a two-way selection structure when checking the value of the first parameter. 2. [15 points] Write a Racket function rem_two that takes a simple list as a parameter and returns a list identical to the parameter except with the second and third elements removed. If the given list does not have at least 3 elements, the function should return an empty list. Remember that you are NOT allowed to use standard functions for finding the length of the list. 3. [25 points] Write a function my_delete that takes two parameters: an atom and a list (which may be a nested list). This function will produce a list, identical to its parameter list, except with all occurrences of an atom parameter removed, no matter how deep they were. The produced list should not have anything in place of the deleted atoms.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

The image contains a programming project description which outlines several tasks that need to be co... 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

Advanced Accounting

Authors: Gail Fayerman

1st Canadian Edition

9781118774113, 1118774116, 111803791X, 978-1118037911

More Books

Students also viewed these Programming questions

Question

The following sample observations were randomlyselected.

Answered: 1 week ago