Chapter 6: Operators, While, and Do While Loops

Lesson 20: Relational Operators

In an earlier chapter we went over one example of a relational operator -the equality operator ==.  In this lesson, we are going to broaden our possibilities in Java by learning about more relational operators and how we can implement them. As you probably recall, we used the equality operator to see if two variables had […]

Lesson 21: Increment and Decrement Operators

In the last lesson we learned about relational operators and how they can be applied in if statements.  In this lesson, we are going to go over increment and decrement operators and how they can be used in our code.  First, let’s go over the increment operator.    The increment operator is basically nothing more than […]

Lesson 22: While Loops

In the last lesson, we learned about increment and decrement operators and how we can use them to add or take away values.  In this lesson, we are going to further explore the usage of the increment operator and learn about while loops. A While loop is a loop that will continue to run until […]

Lesson 23: Do While loop

In the previous lesson, we learned about the while loop and how it is implemented.  However, one of the restraints when using a while loop is that if the condition does not evaluate to true, that the code within the brackets of the while statement will not execute at all.  However, what if we wanted […]

Coding Challenge 6

For our 6th coding challenge, we are going to be working with a while statement and a postfix increment operator.  With these components, we are going to make a brute force age guessing program.   First off, we will need two int variables one we will name guessAge and we will set it to 0.  We […]

%d bloggers like this: