Java (ITEC 4261)
The following are code examples that I built for use in tutoring Intro to Java Programming students. Each code example covers one or more specific topics.
Arrays
For Loops
- Planets (a for loop example. includes some if logic)
- Sum of Columns (use for loops to add data to a matrix and sum the columns)
Formatting
- Kilograms to Pounds Table (uses the format method to build a simple table. includes a for loop)
If Else Logic
- Day of Week (uses if else logic and switch case statements to determine the day of the week for a given date)
Math
- Powers (use the math library to raise a number to a given power)
- Random Numbers (use the math library to generate random numbers)
- Remainders (use the modulus operator to divide and find the remainder)
Matrix
- Sum of Columns (use for loops to add data to a matrix and sum the columns)
Scanner Class (user input)
- Enter a Number (a simple scanner class example)
Switch Case
- Day of Week (uses if else logic and switch case statements to determine the day of the week for a given date)