Question: Part 1 Create a java class FileHandler that has a parameter constructor that takes 2 strings a read from and write to filename.Create a private
Part Create a java class FileHandler that has a parameter constructor that takes strings a read from and write to filename.Create a private data member that is a file reading scanner object reference and a file writing Formatter object reference file handle which will be used to read and write text files from disk.Create private data members that are strings representing names of read and write text files.Create separate public methods on the FileHandler class one to open a file to read returning Boolean true on success and one for opening a file to write returning Boolean true on success.Create separate public methods on the FileHandler class, one to write grades to a file given an ArrayList of strings representing grades returning Boolean true on success. The second method should read grades from a file and populate an ArrayList passed to it of strings representing grades. It should also return Boolean true on success.Write a main function on your FileHandler class and test its functionality by writing test code to check the functionality of the functions you have added to the class.Part Create a main function and a test program to test your FileHandler class by creating this object. Open a file and write some example grades to it Close the file. Then, open the file and try to read them back and see if the same data is retrieved from the file as was initially written to it Also, remember to inspect the text file containing the grades to see if the correct grades are indeed in the file.Part Create a JavaFX project which builds a GUI called GradeIO which creates a basic GUI AnchorPane container. Make sure to see that the project has a fxml file and controller class separate from the main app. Double click on the projects fxml file and it should open Scene Builder for that project.Add a private reference of type ArrayList of strings named for example m gradesFromFile to hold any grades read from file which should be instantiated using operator new in the initialize method of the controller class.Add a private reference of type FileHandler which should be instantiated using operator new in the initialize method of the controller class to be then used for file IOScene Builder ActivitiesGPAAdd a label that will display the GPA given a chosen grade named GPALabel.Add a textbox control that will take input for grade filename to read place a default string filename in it via the properties tab in Scene Builder.Add a button and label it Read Grades File. Add an event handler method named handleReadGrades. Implement the code to use the filehandler object to open a file named given in the filename textbox you created above and to fill the private ArrayList of strings container to store the read grades.As an example for students as a control that can be chosen to display grades the demo has used a combo box control which is loaded with grades once the grade file is read. Then each selection on the combo box is a grade that was read from the file. Any particular selection of the combo box can then be converted into a grade by clicking the Calculate GPA button. It was chosen as it easily allows the program to know which selection ie grade the user has selected. other options are radio buttons as another exampleAdd a button and label it Calculate GPA. Add an event handler method named handleCalcGPA. Write a private method on the JavaFX controller class called convertGradeToGPA which when given a grade which may be a selected grade from the grade display control above returns the equivalent GPA in string form. This string can then be used to display into the GPALabel. In this handler, you will need to get the selected grade from the GUIs Grade control eg combo box call convertGradeToGPA, and display the returned string from that method in that label.Grades GUIAdd a button and label it OK Add an event handler method named handleOKPressed. Implement the code to close the stage component of the application.Extra Credit: Add a button and label it Minimize. Do the research and find the API to minimize a JavaFX application call it test your app to see if it work
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
