online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
import java.util.*; import java.lang.*; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); Players[] players = new Players[4]; for(int i=0; i<players.length; i++){ int id = s.nextInt();s.nextLine(); String name = s.nextLine(); int exp = s.nextInt(); int matchesPlayed = s.nextInt(); int runsScored = s.nextInt(); players[i] = new Players(id, name, exp, matchesPlayed, runsScored); } int target = s.nextInt(); double avgRuns[] = calculateAvg(players, target); for(int i=0; i<avgRuns.length; i++){ if(avgRuns[i]>=80 && avgRuns[i]<=100) System.out.println("Grade A"); else if(avgRuns[i]>=50) System.out.println("Grade B"); else System.out.println("Grade C"); } } public static double[] calculateAvg(Players[] obj, int target){ double arr[]; int j = 0; for(int i=0; i<obj.length; i++){ if(obj[i].getMatchesPlayed()<=target) j+=1; } arr = new double[j]; j = 0; for(int i=0; i<obj.length;i++){ if(obj[i].getMatchesPlayed()<=target) arr[i] = (double) (obj[i].getRunsScored()/obj[i].getMatchesPlayed()); } return arr; } } class Players{ int id; String name; int exp; int matchesPlayed; int runsScored; public Players(int id, String name, int exp, int matchesPlayed, int runsScored){ this.id = id; this.name = name; this.exp = exp; this.matchesPlayed = matchesPlayed; this.runsScored = runsScored; } public int getId(){ return id; } public String getName(){ return name; } public int getExp(){ return exp; } public int getMatchesPlayed(){ return matchesPlayed; } public int getRunsScored(){ return runsScored; } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue