Gr All – Generate random

Being able in Java to generate a random, from an arbitrary number, to another arbitrary number (from lower bound to upper bound). This program generates 20 random numbers to ensure that both the upper bound and the lower bound feature in the solution. Here is the...

Gr 10 – GUIs 102

The weather station project. How to code a Java weather station application (part of a much bigger project) that reads in temperature, wind speed, rain, and cloud cover from 4 different text files and then calculates the average value for each. The average value is...

Gr 10,11,12 – Pause

There are times when we wish our Java code would run a lot slower e.g. when we want to count down from 10 to 0 with 1-second intervals. Here we can use “Thread.sleep(milliseconds)” see line 22 below. Note that the sleep period is not precise as your...