Question: In Scala Programming Language. 17) The following Scala statement stores extracted information 19] In the following Scala example, identify the possible error? class Connection t
17) The following Scala statement stores extracted information 19] In the following Scala example, identify the possible error? class Connection t by applying a regular expression into each variable. Write a regular-expression pattern of strings. Note that the regular def makeconnection val tineout 100 val protocol 100 println("timeout-%d, protocol = %s".fornat (tineout, protocol)) expression only works with the street name that has a white space character in the middle. scala> val pattern(housenum, streetname, aptnum) 100 District Avenue 589" housenum: String-180 streetname: String District Avenue aptnum: String 5e9 val c new Connection c.makeConnection() scalay val pattern(housenum, streetname, aptnum). "2980 NonameStreet 180" scala.MatchError: 2909 NonameStreet 100 (of class java.lang.String) 28 elidecd 120] You are trying to create a method that performs a division operation and returns both quotient and remainder Complete the method "division"). def division (dividend: Int, divisor: Int) [18] Create a class declaration to support the following object creations. You are not allowed to use case class. scala> val obj1 People("James") Obj 1: People- (James, , unknown) scala> val (quotient, remainder) division(509, 3) quotient: Int 166 remainder: Int 2 scala> val obj2 - People("James ", 22, "Officer") ob12: People-(James 22, Officer)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
