Tag: java
-
Lesson 16: User Input
When creating our Java programs, we have been changing the values, compiling, and seeing the results. Wouldn’t it be awesome if we could create programs that can ask for the user’s input and execute whatever we had programmed it to do? Well, we are in luck! Java has a couple of different ways to obtain […]
-
Lessons 15: Comments
As you become more of a proficient programmer and start to create larger more complex programs, you will find out how important it is to organize your code and be able to quickly identify what your code is doing. Fortunately, Java has a way to write comments within our code that we can write to […]
-
Lesson 14: Else If Statements
Last lesson we learned about if else statements and how to get the computer to execute an else statement when the condition within our if statement is not met. In this lesson, we will be going over how to create an else if statement that is linked to the if else statement we learned the […]
-
Lesson 13: If Else Statements
In the last lesson we were introduced to if statements and how they are implemented in Java. In this lesson, we will be going over a more advanced version of the if statement. This statement will be referred to as the if else statement. This applies everything we learned in the lesson prior and adds […]
-
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 5: Printing Variables
Going through Lesson 4, we learned about variables, how to name them, and talked about the variable type “String.” This lesson we are going to learn how to print a variable. Let us start off by creating a class called “PrintingStrings” and implement the Java main method. It should look like this: Next, we are […]