Question: 8.3 Programming ReadWrite - Write in Java and include comments Write an application which will write five student ID numbers and GPAs to a rw
8.3 Programming ReadWrite - Write in Java and include comments
Write an application which will write five student ID numbers and GPAs to a rw file called Stu.dat and then allow you to display the GPA of any student upon entering their ID number, for any number of students.
Directions
Import the classes necessary to support your application.
Create a class called ReadWrite. This class has no properties or behaviors.
Create a main method which will include the following:
Add an appropriate throws statement in the main method.
Create a reference to a text file called Stu.dat with rw access.
Include try and catch blocks for exception handling.
Use a loop to interactively assign student ID numbers and their GPA scores.
With the use of a second loop, display the GPA for specific student ID numbers.
Use a sentinel to determine when you wish to stop the program.
Include a finally block within your program.
Note: User defined methods are not required but may be used if you prefer.
Grading Rubric
| Task | Points |
| Throws clause added in main method | 0.25 |
| Create a reference to the RandomAccessFile class | 1 |
| Include try and catch blocks for exception handling | 1 |
| Use a loop to interactively assign student ID numbers and their GPA scores | 1 |
| Use of a second loop to display the GPA for specific student ID numbers | 1 |
| Use of a sentinel to determine when you wish to stop the program | 0.25 |
| Include a finally block within your program | 0.5 |
| Proper documentation | 1 |
| Program works effectively | 1 |
| Total | 7 |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
