<commit_before>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");
    }
}<commit_msg>Add DecimalFormat<commit_after>package console;

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

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) {
        DecimalFormat df = new DecimalFormat(".##");
        System.out.println("Total percentage of assignment: " + df.format((mark/total * 100)) + "/100");
        System.out.println("Total percentage in unit (weighted): " + df.format((mark/total * weight)) + "/100");
    }
}
{'fraction_non_alphanumeric': 0.11775240653682562, 'fraction_numerical': 0.0044772778150884264, 'mean_word_length': 1.6251468860164513, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '362689', 'n_tokens_mistral': 1153, 'n_tokens_neox': 1068, 'n_words': 285}