Note that for this project you are NOT allowed to use standard Racket functions, except functions...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
The image contains a programming project description which outlines several tasks that need to be co... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Give Three suggestions for a team to engage in professional communication.
-
Write your programs using Racket functional language. Run each of the programs as many times as necessary to show that different situations are handled properly. n the beginning of each part of this...
-
Comprehensive comparison between Linux Kernel and windows Kernel? Comprehensive comparison between Linux System and windows System? Comprehensive comparison between Linux Distributions and windows...
-
A credit card contains 16 digits. It also contains a month and year of expiration. Suppose there are one million users of a credit card with unique card numbers. A hacker randomly selects a 16 digit...
-
The beam has weight density . Determine the internal normal force, shear force, and moment at point C. Units Used: kip = 103 lb Given: = 280lb/ft a = 3 ft b = 7 ft c = 8 ft d = 6 ft B B, A, A,
-
Identify if the statement is a goal, process objective, impact objective or outcome objective: By March 2019, there will be a 10% increase in the proportion of health insurance providers will offer...
-
Analyze the patient satisfaction data in Table B. 17 for multicollinearity. Satisfaction Age Severity Surgical-Medical Anxiety 68 55 50 0 2.1 77 46 24 1 2.8 96 30 46 1 3.3 80 35 48 1 4.5 43 59 58 0 2...
-
Aurora, Inc. estimates manufacturing overhead costs for the 2019 accounting period as follows: Equipment depreciation............................................ $344,000...
-
Exactly two years ago, the U.S. Treasury issued 10-year Treasury notes at par value with a coupon rate of 2.50%. The Face Value of one of these notes was $10,000. Today, you want to purchase that...
-
Suppose that a learning algorithm is trying to find a consistent hypothesis when the classifications of examples are actually random. There are u Boolean attributes, and examples are drawn uniformly...
-
Manufacturing Company Balance Sheet Partial balance sheet data for Diesel Additives Company at August 3 1 are as follows: Line Item Description Amount Finished goods inventory $ 1 7 , 0 0 0 Prepaid...
-
The costs of putting goods into a saleable condition should be charged to (A) The trading account (B) The profit and loss account (C) The statement of financial position (D) None of these
-
When depositing money in your current account you should always use (A) A cheque book (B) A paying-in slip (C) A cash book (D) A general ledger
-
Net profit is calculated in the (A) Trading account (B) Profit and loss account (C) Trial balance (D) Statement of financial position
-
Which of these best describes non-current assets? (A) Items bought to be used in the business (B) Items which will not wear out quickly (C) Expensive items bought for the business (D) Items having a...
-
The descending order in which current assets should be shown in the statement of financial position is (A) Inventory, Accounts receivable. Bank, Cash (B) Cash, Bank, Accounts receivable, Inventory...
-
Consider the following code: int f(int n) { } static int i = 1; if(n = 5) return n; n = n + i; i++; return f(n); What would be the value returned by f(1)? 05 07 08
-
Explain how the graph of each function can be obtained from the graph of y = 1/x or y = 1/x 2 . Then graph f and give the (a) Domain (b) Range. Determine the largest open intervals of the domain over...
-
Assuming the same scenario as BE7-4, the company also buys a derivative contract on January 1, 2013, for U.S. $50,000 to be received in one month. What would be reflected on the financial statements...
-
What is the key difference between a joint operation and a joint venture?
-
You work in the finance department of the City of Oldhaven. Denis Dub, the owner of a successful local car dealership, has just started as a new city councilor. He is confused by the city's financial...
-
A membrane separator is \(3 \mathrm{~mm}\) in diameter, and the membrane permeability was estimated as \(2 \times 10^{-6} \mathrm{~m} / \mathrm{s}\). The solute being transported has a diffusivity of...
-
Develop a simple backmixed model to evaluate the performance of a gas-separation system. Here a feed gas enters a high-pressure chamber with a mole fraction of A of \(x_{\mathrm{Af}}\) and leaves...
-
Pervaporation: a case-study problem. Pervaporation refers to removal of the permeate as vapor and represents an intermediate case between purely gas transport and purely liquid transport in a...
Study smarter with the SolutionInn App