by Editorial | Sep 15, 2024 | Grade 11, Grade 11 - Text Files, Grade 12, Grade 12 - text files
A Java program to write to a text file using PrintWriter (not FileWriter). This program reads in a text file using Scanner – a date and a boolean flag. It adds 45 days to the date and compliments the flag (true to false and false to true) It then writes the new...
by Editorial | Sep 9, 2024 | Grade 11 - Text Files, Grade 12 - text files, PWC grade 11 - All
Reading in a text file into an array of objects using the split( ) method in Java. (There are other ways of doing this for example using useDelimiter( ) with next( ) ) Here is the text file using “#” as the delimiter. Note that there are no extra spaces or...
by Editorial | Feb 8, 2022 | Grade 12 - OOP, Grade 12 - text files
Reading in a text file into an array using the Scanner class and using OOP principals eg static variables and methods, creating objects, passing parameters. This program also uses String handling. There are eight versions of this program. The first versions has no OOP...
by Editorial | Aug 15, 2021 | Grade 12, Grade 12 - text files
Reading records from a text file.Three class program creating an array of people objects – uses LocalDate class. Fields are as follows – First Name, Last Name, Date of Birth. NOTE: The date in the text file is in default date format for LocalDate i.e....
by Editorial | May 17, 2021 | Grade 11, Grade 11 - Text Files, Grade 12, Grade 12 - text files
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....
by Editorial | May 12, 2021 | Grade 11, Grade 11 - Text Files, Grade 12, Grade 12 - text files
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,...