/*
Online Java - IDE, Code Editor, Compiler
Online Java is a quick and easy tool that helps you to build, compile, test your programs
online.
*/
public class Main
{
    public static String takeDownAverage(String scores[])
    {
        System.out.println("Welcome to Online IDE!! Happy Coding :)");
        int [] numbers = new int[scores.length];
        String temp;
        double average;
        double totalNumbers=scores.length;
        double total=0;
        int missingGrade;
        
        for (int i=0; i< scores.length; i++)
        {
            if (scores[i].indexOf("%")==1)
            {
                temp=scores[i].substring(0,1);
                numbers[i]=Integer.valueOf(temp);
            }
            else
            {
                temp=scores[i].substring(0,2);
                numbers[i]=Integer.valueOf(temp);
            }
        }
        
        for (int number: numbers)
        {
            total=total + number;
        }
        
        average = total/totalNumbers;
        missingGrade = (int) ((average-5) * (totalNumbers+1) - total);
        return Integer.toString(missingGrade) +"%";
    }
        
    public static void main(String[] args)
    {
        //String [] scores = new String[]{"95%", "83%", "90%", "87%", "88%", "93%"};
        //String [] scores = new String[]{"10%"};
        String [] scores = new String[]{"53%","79%"};
        System.out.println("Missing grade: " + takeDownAverage(scores));
    }
}