Question: 5Write **TWO** programs. ********* PROGRAM 1: CreateBinaryUsingDataStream.java (1) Read students.txt that contains students' information. Each student' info consists of two lines: name and classification. -

5Write **TWO** programs. ********* PROGRAM 1: CreateBinaryUsingDataStream.java (1) Read "students.txt" that contains students' information. Each student' info consists of two lines: name and classification. - Use a Scanner to read the text file. - Store each student's information in a Student object and then add the Student object in an array list of Student. (2) Create a binary file "studentsDataStream.dat" using DataOutputStream. The program will need to write attribute by attribute to the file. ********* PROGRAM 2: ReadBinaryUsingDataStream.java It will read Student objects from the binary file created by Program 1 and print out the information for each student. In order to earn full credits, the program shouldn't assume knowledge that there are six Student objects are in the file. If your program read exactly 6 Student object, you can still earn partial credits for Program 2.

public class Student { private String name; private int classification; public Student(String name, int classification) { this.name = name; this.classification = classification; } public String getName() { return name; } public int getClassification() { return classification; } @Override public String toString() { return String.format("Student: %s %d", name, classification); } } 

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!