forked from point-software-ag/scala-hack-session
-
Notifications
You must be signed in to change notification settings - Fork 0
01 Scala Principles 01 Session 03 Functions Exercise
Tai Truong edited this page Feb 3, 2014
·
1 revision
In this small exercise you will extend functions and use extensively if-else expressions.
Scala's if-else expression is similar to Java's condition expresion: "condition ? if-value : else-value"
Extend the calculator with a signum operator
Use if-else to convert a boolean input
Use if-else to implement these boolean operations: and, or, negate
if-else expression
- Define some functions: http://www.artima.com/pins1ed/first-steps-in-scala.html#step3
- Scala if then else syntax: http://alvinalexander.com/scala/scala-if-then-else-syntax-returning-value-functional-programming