Question
Written in java Write an application that creates a simple Grade class and then writes Grade Object data to a RandomAccessFile object. Grade Class Instance
Written in java
Write an application that creates a simple Grade class and then writes Grade Object data to a RandomAccessFile object.
Grade Class
Instance variables: studentID:byte (8 bit integer), grade:double
Constructors - two constructor: one default and one constructor with new student ID and new grade as parameters.
Accessor and mutator methods Use Eclipse's functionality to create these method quickly.
toString() - "Student 4's grade is 88.0"
RandomAccessDemo Class
Creates at least 8 Grade objects and write them to a RandomAccessFile, no need to store the objects after they are written to the file. Hint use a loop to create and store the objects. Make sure a record size is determined for each grade.
Develop user interface that:
Locates a grade record based on placement in the file, for example the user might want to see the 5th grade, or the 3rd grade.
Prints a statement identifying the grade and its location such as "The fourth grade is for 85.4 and belongs to student 25".
Ask the user if they wish to look up another grade or quit.
The program must catch and successfully handle (continue with out exiting)
NumberFormatException or InputMismatchException depending how you handle collection of the user input.
Any required checked exception.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started