Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

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

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

9th Edition

0135188148, 978-0135188149, 9781642087611

More Books

Students also viewed these Databases questions

Question

The phrase that best defines a virtual organization is a ( n )

Answered: 1 week ago

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago