Day 22 / Mar 30 (Wed)¶
Morning Exercise: Sum Element Every N Numbers¶
Write a function that checks if every two, three, n
numbers in a sequence are followed by their sum.
def isSumAfterN(n: Int, ns: Seq[Int]): Boolean = ???
Write tests first (using ScalaTest test framework).
Code Review¶
An interactive session that demo'es the following:
- How to use GitHub for collaborative development
git
on command line- Code refactoring with test support (
sbt test
and IntelliJ IDEA) - Contribute to a project using pull requests
Pair Programming¶
Calculator Again¶
Create a command-line application that reads a file with a series of math operations (one on each line) and gives the total at the end.
The following operations are supported:
+
(sum)-
(subtract)*
(multiply)/
(divide)-
(negation) (WARNING: The same symbol with subtraction)
The application should suppport PRINT
operation that prints out the current total to the standard output (stdout) when it appears in a operation file. There can be zero, one or many PRINT
commands.
Operation file should support comments (as lines starting with #
or //
).
A sample operation file:
# + 4 5
- 8
+ 5
-
PRINT
- 7
PRINT
PRINT
/ 2
Working in pairs1:
(daniel,leo)
(ania,krzysiek)
(damian,janek)
(rafal,adam)
(grzegorz,mateusz)
Schedule¶
- 11:45 - 12:30 Lunch break
- 12:30pm - 1:35pm
- 1:40pm - 2:30pm
-
The story, all names, characters, and incidents portrayed in this production are fictitious. No identification with actual persons (living or deceased), places, buildings, and products is intended or should be inferred. (cf. All persons fictitious disclaimer) ↩