Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Terms and Types/Common Types/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<div class="hint">The first one in an <code>Int</code> method <code>toHexString</code>, which returns
the hexadecimal form of the specified integer value.</div>
<div class="hint">The <code>contains()</code> method is utilized to check whether a certain element is present in the range/list/set or not.</div>
<div class="hint">The <code>drop(n)</code> method returns all the elements of the collection except the first <code>n</code> ones.</div>
<div class="hint">The <code>take()</code> method is utilized to return a new collection consisting of the first <code>n</code> elements of the collection.</div>
7 changes: 5 additions & 2 deletions Terms and Types/Method Calls/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Complete the invocations for the described methods.

<div class="hint">The <code>upperCaseMethod()</code> should return "HELLO, SCALA!"</div>
<div class="hint">The <code>absMethod()</code> should return 42.</div>
2 changes: 1 addition & 1 deletion Terms and Types/Operators/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The Scala compiler statically checks that you don’t combine incompatible
expressions.
<br/>
<br/>
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
Expand Down
13 changes: 7 additions & 6 deletions Terms and Types/Primitive Expressions/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -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, `"`).

Expand All @@ -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

Expand All @@ -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`.