Scala Standard Library 2.13.6 - scala.util.Try
www.scala-lang.org › api › 2import scala.io.StdIn import scala.util. {Try, Success, Failure} def divide: Try [ Int] = { val dividend = Try (StdIn.readLine ( "Enter an Int that you'd like to divide: " ).toInt) val divisor = Try (StdIn.readLine ( "Enter an Int that you'd like to divide by: " ).toInt) val problem = dividend.flatMap (x => divisor.map (y => x/y)) problem match …