Help ANYONE PLEASE.. I HAVE THIS COURSEWORK WHICH IS DUE BY NEXT WEEK AND I KNOW I SOUND SORT OF UNSERIOUS BY SAYING THIS BUT I WISH I COULD UNDERSTAND JAVA LIKE PEOPLE DO BUT ITS TOO HARD.IT'S TOO LATE TO CHANGE MY COURSE AS I THOT I WUD GROW INTO IT AND KNOW IT BETTER BUT APPARENTLY NOT YET.. I have this coursework which for people i know its very easy but I hope someone can help me OUT PLEASEEEE... HERE IS THE QUESTION:
1) R1: Design problem: design an application that reads a specific file – once read the file should be
displayed;
2) R2: Plan the R1 design phase and Develop implementation of R1 design;
3) R3: Test R1 implementation;
4) R4: Design problem: design an application that can read a sequence (set) of files – once read the files
should be displayed.
5) R5: Plan the R4 design phase and Develop implementation of R4 design;
6) R6: Test R4 implementation;
7) R7: Reflect on process R1-R6.
This is the only thing i can do
FileReaders
import java.io.*;
import java.util.*;
public class FileReaders
{
private String fileName = "StudentNoTextAndData.txt";
private String fileLines;
private Vector fileVector;
public FileReaders()
{
readFile();
}
public void readFile()
{
try
{
FileReader file = new FileReader("StudentNoTextAndData.txt");
BufferedReader fileStream = new BufferedReader(file);
fileVector = new Vector();
fileLines = fileStream.readLine();
for(int i = 0; fileLines != null; i++)
{
fileName = fileStream.readLine();
fileVector.add(fileLines);
}
fileStream.close();
}
catch(FileNotFoundException e)
{
System.out.println("File not found");
}
catch(IOException e)
{
System.out.println("cant read file");
}
}
}
readFile
import java.io.*;
import java.util.*;
public class ReadFile
{
private String fileName = "";
private String fileLines;
private Vector fileVector;
public ReadFile()
{
readFile();
}
public void readFile()
{
try
{
FileReader file = new FileReader(fileName);
BufferedReader fileStream = new BufferedReader(file);
fileVector = new Vector();
fileLines = fileStream.readLine();
for(int i = 0; fileLines != null; i++)
{
fileName = fileStream.readLine();
fileVector.add(fileLines);
}
fileStream.close();
}
catch(IOException e)
{
System.out.println("cant read file");
}
}
}
I know this might look kind of lame but I really HOPE SOMEONE CAN DO THIS FOR ME AS I WOULD REALLY APPRECIATE IT..PLEASE HELP MEEEEEEEEEEEEEEEEEEEEEE.....