Unit 1. The Basics

 

In Unit 0, you installed everything you need to start coding in Scala. In this unit, you’ll begin writing Scala code. You’ll learn how to program a vending machine in Scala using the same OOP principles already familiar to you. In particular, we will discuss the following subjects:

  • Lesson 4 illustrates the difference between values and variables and the clear separation between mutable and immutable assignments.
  • Lesson 5 introduces conditional constructs to control the execution flow of our program. You’ll learn about loops to repeat the same operation multiple times.
  • Lesson 6 shows you how to define functions in Scala.
  • Lesson 7 demonstrates how to use classes to represent interactions between elements. You’ll learn about abstract classes and how to express a class-subclass relation.
  • Finally, you’ll apply all the principles learned so far to code a vending machine that sells chocolate and granola bars to your customers in lesson 8.

Once comfortable with the basics, you’ll continue with unit 2, where you’ll learn more about object-oriented fundamentals.