Month: June 2020
-
Lesson 12: If-Statements
Thus far, we have been building some basic programs. However, the further we delve into Java, the more we find that in order to build more extensive programs, that we will need to start implementing conditional statements. The best way to describe the usage of conditional statements is that they are statements that are only […]
-
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 […]
-
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 […]
-
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! […]
-
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 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 […]
-
Coding Challenge 2
For this challenge, we are going to construct a class called CodingChallenge2 and use the print method that prints something like the following: My favorite color starts with the letter G and I am 18 years old. Instead of creating one large String, we are going to use the addition symbol to join the following […]
-
Lesson 7: Numerical Variables
After learning about variables and printing Strings, we are now going to learn about some numerical variables that we encounter in Java. As you will find out with practice, many Java programs require a fair bit of numerical data. The best and most common way to store numerical values are by using the variable types: […]