A lecturer has a text file which includes a list of students name and final exam marks. Create a Java program which:

  • Read all the records from the file
  • Sort all the records from the file and
  • Exit from application

There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in doing your homework for you.

DaniWeb Member Rules (which you agreed to when you signed up) include:
"Do provide evidence of having done some work yourself if posting questions from school or work assignments"

Post what you have done so far and someone will help you from there.

import java.util.Scanner;
import java.io.*;
import javax.swing.JOptionPane;
public class WriteFile {

    public static void main(String[] args) throws FileNotFoundException, IOException  {

  FileWriter file = new FileWriter("Student Name and Scores.txt");
 //PrintStream output = new PrintStream(new File("output.txt"));
    Scanner scan = new Scanner (System.in);  
    System.out.print("Enter number of Students in Class: ");
    int k = scan.nextInt();
    PrintWriter output = new PrintWriter(file);
    for (int j=1; j <= k; j++){
        PrintWriter output1 = new PrintWriter(file);
    System.out.print("Enter Student First Name: ");
    String Name = scan.next();
    output.print(" ");
    System.out.print("Enter Student Last Name: ");
    String lastName = scan.next();
    System.out.print("Enter Student Scores: ");
    double score = scan.nextDouble();


    System.out.println("Names and Scores are entered");



import java.io.File;
import java.io.FileNotFoundException;
import java.util.*;

public class ReadData {

    public static void main (String [] args) throws FileNotFoundException {
  try {
   File file = new File("Student Name and Scores.txt");

   Scanner scanner = new Scanner(file);
   while (scanner.hasNextLine()) {
  } catch (FileNotFoundException e) {

That is what i have done so far, i dont know how i want to sort them according to the numbers input by the user.