Course Solutions Uncategorized (Solved) : Begin Session Import Scalamath Q26595851 . . . .

(Solved) : Begin Session Import Scalamath Q26595851 . . . .

 

To do this, begin your session with

      import scala.math._

1. Problem Write a function that given the coefficients of a quadratic polynomial ax2+bx+c, returns the real roots: Option [(Double, solve (2, solve (1, solve (1, -2, -4) 0, 1) 0, -1) Double)】 resO: res1 Option [ (Double, Double)J None res2: Option [ (Double, Double)Some ( (1.0,-1.0)) > . Some ((2.0,-1.0)) Notes: Our version of solve returns an option containing a tuple. Options and tuples are discussed here: Options. Maps and Tuples. When there are two real roots, as in the first example, solve returns a Some object containing the roots as a pair of doubles Whem ihcre are no noot, as in hte second cuampl, solve retuns None How would you modify solve to return complex roots

1.

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post