Question: Need help on problems 1, 2, 3, 6, 7, 8 Use Scala worksheet Mathematics To begin In Eclipse create a Scala project called MathLab. Add

Need help on problems 1, 2, 3, 6, 7, 8

Use Scala worksheet

Need help on problems 1, 2, 3, 6, 7, 8 Use Scala

worksheet Mathematics To begin In Eclipse create a Scala project called MathLab.

Mathematics To begin In Eclipse create a Scala project called MathLab. Add a worksheet to this project called session Add a Scala interpreter to this project just for fun In the session worksheet define and test the following functions. Your implementations should be as concise as possible. You should use library functions whenever possible. You should use operator symbols whenever possi Hints Scala numeric classes include: Byte, Short, Int, Long, Float, Double Unlike Java, Scala doesn't have scalar types such as int and double. Remember, everything in Scala is an object! Of course the Numeric classes have useful methods. but more useful methods can be found in the scala.math package: ht Import all definitions from scala.math. Recall that this only means you don't have to call math.sin(x). you can call sin(x) instead. To do this. begin your session with th To end: Export session sc to your file system and send it to the grader by the deadline. Problem Write a function that given the coefficients of a quadratic polynomial ax bx c. returns the real roots solve (2, -2, -4) reso: Option (Double, Double) some (2.0, -1.0) real: option Double Double) J None aol e res Option (Double, Double) Some r (1.0, -1.0) eolve Our version of solve returns an option containing a tuple. ns and tuples are discussed here Options Maps and T When there are two real roots, as in the first example, solve returns a Some object containing the roots as a pair of doubles. When there are no roots, as in the second example, solve returns None. How would you modify solve to return complex roots Write a function that computes the distance between two points in the x-y plane: dist (1, 1), (o, o 1.4142135 623730 95 sq (2) dist (13 0) r (0, 0)) 3. Notes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!