Port two more programs from C to Scala.

Test Plan: Ran locally.

Reviewed By: jcarter