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
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)
##############################
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) voidStep 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