Exercise 3. Numbers and Math

Every programming language has some kind of way of doing numbers and math. Do not worry: programmers lie frequently about being math geniuses when they really aren’t. If they were math geniuses, they would be doing math, not writing buggy web frameworks so they can drive race cars.

This exercise has lots of math symbols. Let’s name them right away so you know what they are called. As you type each one in, say the name. When saying them feels boring you can stop saying them. Here are the names:

+ plus

- minus

/ slash

* asterisk

% percent

< less-than

> greater-than

<= less-than-equal

>= greater-than-equal

Notice how the operations are missing? After you type in the code for this exercise, go back and ...

Get Learn Ruby the Hard Way: A Simple and Idiomatic Introduction to the Imaginative World of Computational Thinking with Code, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.