diff --git a/Terms and Types/Common Types/task.md b/Terms and Types/Common Types/task.md index 0abe37a..7b979f5 100644 --- a/Terms and Types/Common Types/task.md +++ b/Terms and Types/Common Types/task.md @@ -11,3 +11,10 @@ Note that type names always begin with an upper case letter. ## Exercise Here are some more methods of standard types. Can you guess what they do? +Complete their invocations. + +
The first one in an Int method toHexString, which returns +the hexadecimal form of the specified integer value.
+
The contains() method is utilized to check whether a certain element is present in the range/list/set or not.
+
The drop(n) method returns all the elements of the collection except the first n ones.
+
The take() method is utilized to return a new collection consisting of the first n elements of the collection.
diff --git a/Terms and Types/Method Calls/task.md b/Terms and Types/Method Calls/task.md index f96d1e0..a69652d 100644 --- a/Terms and Types/Method Calls/task.md +++ b/Terms and Types/Method Calls/task.md @@ -20,10 +20,13 @@ The object on which the method is applied is named the *target object*. Methods can have *parameters*. They are supplied between parentheses. -In the below examples, the `abs` method returns the absolute value of a +The `abs` method returns the absolute value of a number, and the `toUpperCase` method returns the target `String` in upper case. #### Exercise -Complete the methods invocations. \ No newline at end of file +Complete the invocations for the described methods. + +
The upperCaseMethod() should return "HELLO, SCALA!"
+
The absMethod() should return 42.
\ No newline at end of file diff --git a/Terms and Types/Operators/task.md b/Terms and Types/Operators/task.md index 067301e..5c7735a 100644 --- a/Terms and Types/Operators/task.md +++ b/Terms and Types/Operators/task.md @@ -29,7 +29,7 @@ The Scala compiler statically checks that you don’t combine incompatible expressions.

-Fill the following blank with values whose type is +Try filling the blank in the code editor with values whose type is different from `Int` and see the result. ## Exercise diff --git a/Terms and Types/Primitive Expressions/task.md b/Terms and Types/Primitive Expressions/task.md index 9b1bdba..bca37fe 100644 --- a/Terms and Types/Primitive Expressions/task.md +++ b/Terms and Types/Primitive Expressions/task.md @@ -25,15 +25,15 @@ - The number “1”: - 1 + `1` - The boolean value "true": - true + `true` - The text "Hello, Scala!": - "Hello, Scala!" + `"Hello, Scala!"` (Note the usage of double quotes, `"`). @@ -44,11 +44,11 @@ - How many is one plus two? - 1 + 2 + `1 + 2` - What is the result of the concatenation of the texts “Hello, ” and “Scala!”? - "Hello, " ++ "Scala!" + `"Hello, " ++ "Scala!"` ## Evaluation @@ -70,4 +70,5 @@ ## Exercise - Complete the expression to return "Hello, Scala!" +Complete the expression in `sayHello()` to return "Hello, Scala!". +Complete the expression in `sumTheNumbers()` to return `4`.