Lecture Date: Wednesday, February 4
Let’s start by looking again at the GradeCalculator.java.
Consider another way of figuring out the letter by looking at the individual digits of the grade:
1 2 3 4 5 6 7
We can intentionally leverage integer division to get the tens place of the grade.
To get the ones place, we will use the modulus operator, which gives us the remainder after division.
We will spend time today touching on the following:
- Scope (and scope errors)
- Reviews the logical operators:
== ! != < > <= >= && ||
- How to exit your program
Then, we’ll start on loops if we have time.
There are three types of loops that we will focus on today:
Here’s how a
for loop basically works:
Can we look through some text and replace certain words? Let’s try it!
Code from today: Decisions2.java