How to edit a java code


Discuss the below java program (that is what I have so far its not displaying the medal count).

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

final int COUNTRIES = 7;

final int MEDALS = 3;

String[]country = { "CANADA", "CHINA","GERMANY", "COREA", "JAPAN", "RUSSIA" } ;

int[][]count = {{1,0,1},{1,1,0},{1,1,1,},{1,1,1},{1,0,0},{1,0,0}, {1,0,0}};

System.out.print( "Country Gold Silver Bronze Total" );

for(int i = 0; i < COUNTRIES ; i ++ ){

(System.out.printf("%15s", countries[i]);

int total = 0;
for(int j = 0; j < MEDALS ; j ++){

(System.out.printf("%8d" , counts [i][j]);

= total = total + counts[i][j];}

(System.out.printf("%d/n" , total);

}
}

Solution Preview :

Prepared by a verified Expert
JAVA Programming: How to edit a java code
Reference No:- TGS01934217

Now Priced at $20 (50% Discount)

Recommended (95%)

Rated (4.7/5)