Question: Java: Problem Description studentsInput.txt file contains students data. Each line represents one student record and each record contains four tokens separated by &: name&id&password&gpa write

Java: Problem Description

studentsInput.txt file contains students data. Each line represents one student record and each record contains four tokens separated by &:

name&id&password&gpa

write a program that reads data from this file and populates an ArrayList with appropriate objects.

Once that list is created the program prints the objects to the console and also writes them to another file called studentOutput.txt (see example 11.9 on how to create PrintWriter object and how to use its println method to write to a file). Each line should have line number inserted.

See the UML diagram and the sample runs below. studentInput.txt and studentInputErr.txt are provided.

Run the program twice: once with studentInput.txt file (see Sample run #1) and the second time with studentInputErr.txt file (see Sample run #2)

Java: Problem Description studentsInput.txt file contains students data. Each line represents one

student record and each record contains four tokens separated by &: name&id&password&gpa

write a program that reads data from this file and populates an

ArrayList with appropriate objects. Once that list is created the program prints

##############################

studentsInput.txt

######################

Mike Apple&mike1&fruit&3.725 Jill Dill&jill2&herb&4.0 Jack Pepper&jack3&seasoning&4.3 Mary Rose&mary4&flower&2.9999

########################

studentsInputErr.txt

##########################

Mike Apple&mike1&3.725&fruit Jill Dill&jill2&herb&4.0 Jack Pepper&jack3&seasoning& Mary Rose&mary4&flower&2.9999

UML Diagram StudentRecord GPA e name DecimalFormat String String String double eid e password in StudentRecord(String, String, String, double) mtoString) String ereate ProcessStudents m main (String[I) void

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!