Lesson 8: Addition in Java
In the last chapter, we were introduced to how to use the addition symbol + to join sentences together. In this lesson, we are going to go over how to add numbers together in Java. There are several different ways we can go about adding numbers together in Java. One method is to add numbers…
Lesson 9: Subtraction, Multiplication, and Division in Java
In the last lesson we learned how to use addition in Java. In this lesson, we are going to move on to subtraction, multiplication, and division! Luckily, all the principles that we learned with addition still apply. Only the symbols and results are different. Let us start by looking at subtraction. Subtraction as you can…
Lesson 10: Constructing Math Equations with Parentheses
In the last couple of lessons, we have been going over different operator symbols to use for making our desired math equation. These operators have been: Addition +Subtraction –Multiplication *Division / However, what if we want to have more complex equations? Just like in algebra, we are going to be using parenthesis! If you have…
Lesson 11: Boolean Math Expressions
Although you probably have not heard of Boolean math, you will be happy to know that is an easy concept to grasp. Boolean expressions have a true or false value. In other words, there are only two possible outcomes for a Boolean value. To declare a Boolean value, we declare the variable type by putting…
Coding Challenge 3
For this challenge, we are going to create a class called CodingChallenge3 and print how many cups of coffee consumed per year using multiplication in Java. First, we will create an int called coffeePerDay and put how many cups of coffee you have per day. Then, create another int called daysInYear that represents how many…