GRADE 11
JAVA MATERIAL FOR GRADE 11 STUDENTS
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 computer is...
Gr 11 – Bare Bones 3 Class
Java - Three class template. In the grade 11 exam you are expected to write applications with at least three classes i.e. A UI class. Creates the manager class. Calls the methods it needs. May have some input and output. A manager class for all your methods. A...
Gr 11,12 – JSON
JSON is a file format or text-based data structure that we can use with, or in place, of text files. JSON is intended to replace file format XML which you may have come across before. Here is a video explaining JSON Click here IT teacher Sandra De Lange shared this...
Gr 11,12 – Windows More
It is difficult to understand IT Theory if you don't understand your own Windows computer. What type of processor do you have? Does it hyperthread? How much physical RAM and how much virtual RAM do you have? Are your USB ports 2.0 or 3.0? Does your computer boot using...
Gr 11 – Nested loops with Debug
Nested loops can be difficult to visualize and are easily misunderstood. Here is a presentation that uses the Step function in the Debug mode of jGRASP to show you exactly how 3 nested loops interact. Click here
Gr 11 – Search array
Searching an array in Java Searching for a value in an unsorted array is a standard algorithm that loops from the first element and moves to the last element. These are all two-class programs using an OOP approach where arrays are passed as parameters. Here the...
Gr 11 – Array as parameter
A typed method can only return one value. (Yes, a method MAY have several return statements but only one of them will execute depending on the condition.) Sometimes we need to return more than one value. To get around the limitation above we can return one array, that...
Gr 11 – NetBeans Shortcuts
NetBeans can be very helpful - sometimes toooo helpful which is why we start coding in jGRASP. Here are some shortcuts to begin with . . . psvm <tab> - public static void main(String[]args) sout <tab> - System.out.println(" ") for <tab> - the simple...
Gr 11 – Reading in a text file
Grade 11 - Reading in a text file into an array or into parallel arrays (array sets). Without a delimiter and with a delimiter. Grade 12 - Reading in a text file into an array of objects GRADE 11 1) Reading in a simple text file using the Scanner class. We create a...
Gr 12 – Text and Scanner
Being able to read in a text file into an array of objects using the Scanner class is mission-critical in the final grade 12 practical exam paper. Here are some examples for you to practice with. 1) This text file has 5 fields ie Order, Restaurant, Description,...