1. Hello REPL!
Activity 1.01: Performing Basic Operations
Solution:
- Open the REPL.
- Print the message
"I am not afraid of parentheses"
to motivate yourself:user=> (println "I am not afraid of parentheses") I am not afraid of parentheses nil
- Add 1, 2, and 3 and multiply the result by 10 minus 3, which corresponds to the following
infix
notation: (1 + 2 + 3) * (10 - 3):user=> (* (+ 1 2 3) (- 10 3)) 42
- Print the message
"Well done!"
to congratulate yourself:user=> (println "Well done!") Well done! Nil
- Exit the REPL by pressing Ctrl + D or typing the following command:
user=> (System/exit 0)
By completing this activity, you have written code that prints a message to the standard output. You have also performed some mathematical operations using the prefix notation and nested expressions.
Activity 1.02: Predicting the Atmospheric Carbon Dioxide Level
Solution:
- Open your favorite editor and...