> Complete the quadrant function below, which should return the quadrant of the given x, y...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
> Complete the quadrant function below, which should return the quadrant of the given x, y point according to the diagram on the right (borrowed from Wikipedia). Points that lie on an axis do not belong to any quandrant. Hints: (a) define a helper function for the sign of an integer, (b) match against a pair. type quad I | II | III | IV type sign Neg | Zero | Pos let sign (x:int) : sign = let quadrant: int*int >quad option = fu match... with -> Some I II 10 y-axis P(3.5) x-axis -10 5 10 (0.0) origin IV III -10 -> Some II -> Some III -> Some IV -> None Rewrite the quadrant function to use the when syntax. You won't need your helper function from before. let quadrant when ... ... when... when ... when... when ... -> None int int > quad option = function -> Some I -> Some II -> Some III -> Some IV > Complete the quadrant function below, which should return the quadrant of the given x, y point according to the diagram on the right (borrowed from Wikipedia). Points that lie on an axis do not belong to any quandrant. Hints: (a) define a helper function for the sign of an integer, (b) match against a pair. type quad I | II | III | IV type sign Neg | Zero | Pos let sign (x:int) : sign = let quadrant: int*int >quad option = fu match... with -> Some I II 10 y-axis P(3.5) x-axis -10 5 10 (0.0) origin IV III -10 -> Some II -> Some III -> Some IV -> None Rewrite the quadrant function to use the when syntax. You won't need your helper function from before. let quadrant when ... ... when... when ... when... when ... -> None int int > quad option = function -> Some I -> Some II -> Some III -> Some IV
Expert Answer:
Posted Date:
Students also viewed these programming questions
-
Portray in words what transforms you would have to make to your execution to some degree (a) to accomplish this and remark on the benefits and detriments of this thought.You are approached to compose...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Write an application that works as a comparator. Your program should read two numbers from the user and print 0 if they are equal to each other, 1 if the first number is greater, and 1 if the second...
-
In the photo on page 398, Bob Floras job as a quality assurance product evaluator is discussed. Bob is expected to inspect 130 ornaments per day. a) If he works an 8-hour day, how many minutes is he...
-
Suppose Alice, with a Web-based e-mail account (such as Hotmail or gmail), sends a message to Bob, who accesses his mail from his mail server using POP3. Discuss how the message gets from Alice's...
-
Diagram the flow of data within general accounting in recording cash receipts transactions.
-
In an effort to increase capacity in Work Center 111 for week 13, Yankee Machine Shop has authorized overtime. The work center will be staffed 12 hours per day for six days. Because of the additional...
-
Business success is often tied to effectively managed strategies. Using the Internet, study Starbuck's current performance. Based on analysis, do you judge Starbucks to be a success? Why or why not?...
-
What is the Yield-To-Maturity of the current bonds outstanding? 3 4 5 8 9 0 3 4 5 A 9 0 1 Risk free Bonds Data 7 Preferred stock Treasury Bond inflation (5 years) inflation (next 5) MRP (formula) DRP...
-
TIENDAS DI NAPOLI Tiendas Di Napoli is a renowned department store chain located in the central area of Chile. Over time it has incorporated new technologies and has also maintained certain things...
-
By considering one or more suitably chosen portfolios, which you should specify care- fully, and by applying the no-arbitrage principle, show that the value at time 120 of a forward contract struck...
-
Based on the following information, calculate the NPV Analysis Grid: NPV vs Discount Rate & Year 1 Sales Ranges table. CoursHeroTranscribedText 22 = Net Income 23 + Depreciation 24 Operating CF 25...
-
You would like to borrow $25,000 from a local bank.You will make equal monthly payments over a fifteen-year period.What will your monthly payment be if yearly interest rate is 6%? A company is...
-
The following helicopter has four rotor blades rotating at angular velocity 2 (rad/sec). It's flying forward at velocity Voo. The blade angle y is called the azimuth; it is zero degrees for a blade...
-
What is really meant by pure competition as a market model? What connections can you make? What are some short and long run issues?
-
In Problem use geometric formulas to find the unsigned area between the graph of y = f(x) and the x axis over the indicated interval. f(x) = x + 5; [0, 4]
-
Find \(\mu\) and \(\sigma\) for the distribution of the phase error of Exercise 5.9. Data From Exercise 5.9 5.9 Let the phase error in a tracking device have probabil- ity density f(x) = (9) = { o...
-
Find \(\mu\) for the distribution of the satisfactory service of Exercise 5.10. Data From Exercise 5.10 5.10 The length of satisfactory service (years) provided by a certain model of laptop computer...
-
Show that \(\mu_{2}^{\prime}\) and, hence, \(\sigma^{2}\) do not exist for the probability density of Exercise 5.6. Data From Exercise 5.6 5.6 Given the probability density f(x) = -
Study smarter with the SolutionInn App