Write a program that reads in a student file and creates Student.java objects wi
ID: 3891704 • Letter: W
Question
Write a program that reads in a student file and creates Student.java objects with the following fields: first name, last name, GPA, and student ID. The objects will be stored in an array of Students in a class named StudentSearcher.java. Provide the user with a list of possible student IDs to search from. When a user enters in a student ID, the program will search the array and display the found student's GPA. The program will continue to search students until the user exits the program. MY QUESTION IS THAT IVE LOOKED AT THE CODE PRESENTED ON CHEGG. ALL OF THESE EXAMPLES USE TEXT FILES THAT ARE PUT INTO STUDENT SEARCHER. THIS MIGHT BE A STUPID QUESTION BUT HOW DO YOU MAKE A TEXT FILE? IVE LOOKED ON LINE AND I HAVENT FOUND WHAT I NEED. I WANTED TO KNOW HOW TO CREATE A TEXT FILE AND USE IT IN THE CODE. ALSO CAN THIS CODE BE DONE WITHOUT USING TEXT FILES? THANKS FOR ANY HELP :)
Explanation / Answer
You make a text file by analyzing the code how it takes the input from the user and store the text file to the path where it is accessible.
And yes you can do this code without text files by making array of student objects and then scanning through the array to find the student with required attributes.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.