Important notes• Signatures and purpose statements are ONLY required for function definitions — you do NOT write them for named constants or for non-function-definition compound expressions.• Remember: A signature in Racket is written in a comment, and it includes the name of the function, the types of expressions it expects, and the type of expression it returns. This should be written as discussed in class. For example,; signature: purple-star: number -> image• Remember: a purpose statement in Racket is written in a comment, and it describes what the function expects and describes what the function returns (and if the function has side-effects, it also describes those side-effects). For example,; purpose: expects a size in pixels, the distance between; points of a 5-pointed-star, and returns an image; of a solid purple star of that size• Remember: it is a COURSE STYLE STANDARD that named constants are to be descriptive and written in all-uppercase — for example,(define WIDTH 300)• You should use blank lines to separate your answers for the different parts of the homework problems. If you would like to add comments noting which part each answer is for, that is fine, too!• Because the design recipe is so important, you will receive significant credit for the signature, purpose, header, and examples/check-expects portions of your functions. Typically you’ll get at least half-credit for a correct signature, purpose, header, and examples/check-expects, even if your function body is not correct (and, you’ll typically lose at least half-credit if you omit these or do them poorly, even if your function body is correct).Problem 1Start up DrRacket, (if necessary) setting the language to How To Design Programs – Beginning Student level, and adding the HTDP/2e versions of the image and universe teachpacks by putting these lines at the beginning of your Definitions window:(require 2htdp/image)(require 2htdp/universe)Put a blank line, and then type in:• a comment-line containing your name,• followed by a comment-line containing CS 111 – HW 2,• followed by a comment-line giving the date you last modified this homework,• followed by a comment-line with no other text in it — for example:; type in YOUR name; CS 111 – HW 2; last modified: (today’s date);Below this, after a blank line, now type the comment lines:;; Problem 1;Now, consider a function that is to produce the area of a triangle.1 part aHow many and what type of expressions should such a function expect, to be able to return such an area?Decide on a good, descriptive name for this function, and write an appropriate signature comment for this function.1 part bWrite an appropriate purpose statement comment for this function.1 part cWrite an appropriate function header for this function (putting … ) for its body for now).1 part dWrite at least 2 specific tests/check-expect expressions for this function. Interestingly, you may actually place these either before or after your not-yet-completed function definition, whichever you prefer.1 part eOnly NOW should you replace the … in the function’s body with an appropriate expression to complete this function.Run and test your function until you are satisfied that it passes its tests and works correctly.Finally, include at least 2 example calls of your function (such that you will see their results) after your function definition.Problem 2Next, in your definitions window, after a blank line, type the comment lines:;; Problem 2;Consider a function that praises a given person for a job well-done. Given a person’s name, it returns Good job, …that person’s name… ! (Optionally, you may change the exact wording of the praise, as long as it includes the person’s name and ends with at least one exclamation point.)2 part aHow many and what type of expressions should such a function expect, to be able to return this praise?Decide on a good, descriptive name for this function, and write an appropriate signature comment for this function.2 part bWrite an appropriate purpose statement comment for this function.2 part cWrite an appropriate function header for this function (putting … ) for its body for now).2 part dWrite at least two specific tests/check-expect expressions for this function, placed either before or after your not-yet-completed function definition, whichever you prefer.2 part eOnly NOW should you replace the … in the function’s body with an appropriate expression to complete this function.Run and test your function until you are satisfied that it passes its tests and works correctly.Finally, include at least 2 example calls of your function (such that you will see their results) after your function definition.Problem 3Next, in your definitions window, after a blank line, type the comment lines:;; Problem 3;You decide it would be useful to be able to take an image, and a string caption for that image, and create a new image that includes the given image above its caption, such that the caption is depicted in 20-pixel-high black letters that are actually part of the image.3 part aDecide on a good, descriptive name for this function, and write an appropriate signature comment for this function.3 part bWrite an appropriate purpose statement comment for this function.3 part cWrite an appropriate function header for this function (putting … ) for its body for now).3 part dWrite at least two specific tests/check-expect expressions for this function, placed either before or after your not-yet-completed function definition, whichever you prefer.3 part eOnly NOW should you replace the … in the function’s body with an appropriate expression to complete this function.Run and test your function until you are satisfied that it passes its tests and works correctly.Finally, include at least 2 example calls of your function (such that you will see their results) after your function definition.Problem 4Next, in your definitions window, after a blank line, type the comment lines:;; Problem 4;Consider a function total-ounces that expects a number of pounds and a number of ounces, and returns the total number of ounces. (For example, the value of the expression (total-ounces 2 5) should be 37, because 2 pounds and 5 ounces is 37 ounces overall.)4 part aThis part comes BEFORE starting function total-ounces!FIRST: write a Racket definition for a named constant that will define the name OZ-PER-LB to be the number of ounces in a pound. (OZ-PER-LB is NOT a function! It isjust a number, the number of ounces in a single pound.)4 part bNOW you are starting the design recipe for function total-ounces.NOW, write an appropriate signature comment for the function total-ounces.4 part cWrite an appropriate purpose statement comment for total-ounces.4 part dWrite an appropriate function header for total-ounces (putting … ) for its body for now).4 part eWrite at least two specific tests/check-expect expressions for total-ounces,• at least one for a number of pounds of 0, and• at least one for a number of pounds greater than 1,…placed either before or after your not-yet-completed function definition, whichever you prefer.4 part fOnly NOW should you replace the … in total-ounces’ body with an appropriate expression to complete it. For full credit, make sure that you use the named constantOZ-PER-LB appropriately within this expression.Run and test your function until you are satisfied that it passes its tests and works correctly.Finally, include at least 2 example calls of your function (such that you will see their results) after your function definition.Problem 5Next, in your definitions window, after a blank line, type the comment lines:;; Problem 5;(This is adapted from Homework 1 of J. Marshall’s “The Way of the Program” course at Sarah Lawrence College.)The Tasty-Waking coffee roasters sells whole-bean coffee at $9.50 per pound plus the cost of shipping. Each order ships for $1.37 per pound plus $3.50 fixed cost for overhead.(So, if someone buys 1 pound of their whole-bean coffee, the total price is $14.37; if someone buys 2 pounds of their whole-bean coffee, the total price is $25.24; if someone buys 5 pounds, the total is $57.85.)5 part aThe description above includes three constant, unchanging values. Define an appropriate, descriptive named constant for each of these values.5 part bNow consider a function whose purpose is to calculate the total price for an order. Given that you already know the values for the named constants given in Problem 5 part a, how many and what type of additional expressions should such a function expect, to be able to calculate the price of a coffee order?Write an appropriate signature comment for the function.(Hint: don’t include named constants in the signature! Only consider what the function needs BESIDES the named constants to complete the task.)5 part cWrite an appropriate purpose statement comment for this function.5 part dWrite an appropriate function header for this function (putting … ) for its body for now).(Hint: remember that named constants do not belong in a function header, either.)5 part eWrite at least two specific examples/tests/check-expect expressions for this function, placed either before or after your not-yet-completed function definition, whichever you prefer.5 part fFinally, replace the … in this function’s body with an appropriate expression to complete it. For full credit, make sure that NOW you use the named constants from 4 part a appropriately within this expression.Run and test your function until you are satisfied that it passes its tests and works correctly.Finally, include at least 2 example calls of your function (such that you will see their results) after your function definition.Problem 6Next, in your definitions window, after a blank line, type the comment lines:;; Problem 6;Decide on a function that will take one or more parameters and return an image as a result. It can be anything not yet written in class or on a previous homework problem (variations on functions done in class or a homework problem are fine).6 part aDecide on a good, descriptive name for your function, and write an appropriate signature comment for this function.6 part bWrite an appropriate purpose statement comment for this function.6 part cWrite an appropriate function header for this function (putting … ) for its body for now).6 part dWrite at least two specific tests/check-expect expressions for this function, placed either before or after your not-yet-completed function definition, whichever you prefer.6 part eOnly NOW should you replace the … in the function’s body with an appropriate expression to complete this function.Run and test your function until you are satisfied that it passes its tests and works correctly.Finally, include at least 2 example calls of your function (such that you will see their results) after your function definition.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
Ace Writing Center has stood as the world’s leading custom essay writing services providers. Once you enter all the details in the order form under the place order button, the rest is up to us.
Essays
At Ace Writing Center, Nowadays, students normally have extremely busy schedules. You will note that some of them have to take on some evening or weekend jobs in order to get some income that can help them to sustain in college or in the university. This can deny them a chance to write all the essays given. Others usually get bombarded with a lot of work by their lecturers. This can still delay such students from working on all their essays. However, some of them usually try to work on all these essays but end up delivering their work late. This can prevent them from graduating since most lecturers are strict on deadlines. If you want to write a business essay, the wise way is to hire an outstanding essay writing service like us, so that you can get the best results. If you are keen, you will note that many companies usually overcharge their customers. Some of them are there only to make money. And in reality, they really don’t care to build a long term commitment with students. You should not choose such companies. You should take your time and choose a reliable company to work with. Ace Writing Center is the ultimate solution for you. We have been offering our writing service for more than 7 years. This is a clear indication that you will get quality essay writing service. We have a wide range of writers who can work on any business essay that you might have. We believe in doing extensive research so that we can provide quality work to all our clients. .
Admissions
Admission and Business Papers
Have you ever had to write an admission essay for college? The majority of students face the same issues when applying to a university or college and many in such situations decide they need professional help to cope with this matter. They get in a situation when the deadline keeps coming closer but lack motivation to start because they are just not sure if their writing skills are strong enough. We have a solution for you! Ace Writing Center is the best admission essay writing service with a large professional team and years of experience in providing high-quality papers to students of all levels and faculties. The mission of our team is to help students make their dreams of entering a good college come true and that’s what we offer!.
Editing
Editing and Proofreading
Sometimes all the words for your paper just flow out of your mind and into your fingers. You type quickly at your keyboard and there they are, your beautiful words right there on the screen. But you have no idea how to polish it up. You may be wishing there was a paper writing service that offered this type of writing service. Look no more! Here at Ace Writing Center, we offer you an editing and proofreading option that you can't find anywhere else..
Coursework
College Essay Writing
In case you are familiar Ace Writing Center, you know the way to distinguish a better company from a cheap one exactly. First of all, poor service website does not have a sufficient support. We think support team is an essential part of success; it has to answer all clients’ questions and be a connecting link between clients and their writers. On our web-service you will get answers about anything you need and your writer will receive all your instructions, assignments and requirements exactly and swiftly. A writing service that we run has got a flexible pricing system that will save you from senseless wastes and many bonus systems that let you sparing money for something important for you.