package console;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class GradeTrackerConsole {
    public static void main(String[] args) {

        String input;
        int weighting;
        double mark;
        int total;

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        System.out.println("** -- Grade Tracker Console -- **");

        while (true) {
            try {
                System.out.println("Enter in assignment weighting (numeric): ");
                input = br.readLine();
                weighting = Integer.parseInt(input);

                System.out.println("Enter in mark: ");
                input = br.readLine();
                mark = Double.parseDouble(input);

                System.out.println("What was the mark out of? ");
                input = br.readLine();
                total = Integer.parseInt(input);

                calculateValues(weighting, mark, total);

                while (true) {
                    System.out.println("Do you want to submit another entry? Y/N: ");
                    input = br.readLine();
                    if (input.equals("Y") || input.equals("y")) {
                        break;
                    }   else if (input.equals("N") || input.equals("n")) {
                        System.out.println("Thank you for using the Grade Tracker Console");
                        System.exit(0);
                    }   else {
                        System.out.println("Invalid response, try again");
                    }
                }

            }   catch (NumberFormatException e) {
                System.out.println("Input error, use numbers only");
            }   catch (IOException e) {
                System.out.println("I/O error, please try again");
            }
        }
    }

    private static void calculateValues(int weight, double mark, int total) {
        System.out.println("Total percentage of assignment: " + (mark/total * 100) + "/100");
        System.out.println("Total percentage in unit (weighted): " + (mark/total * weight) + "/100");
    }
}
@@ -103,16 +103,48 @@
 mReader;
+%0Aimport java.text.DecimalFormat;
 %0A%0Apublic
@@ -1969,24 +1969,77 @@
 nt total) %7B%0A
+        DecimalFormat df = new DecimalFormat(%22.##%22);%0A
         Syst
@@ -2086,24 +2086,34 @@
 gnment: %22 + 
+df.format(
 (mark/total 
@@ -2118,16 +2118,17 @@
 l * 100)
+)
  + %22/100
@@ -2200,16 +2200,26 @@
 d): %22 + 
+df.format(
 (mark/to
@@ -2231,16 +2231,17 @@
  weight)
+)
  + %22/100

Add DecimalFormat