Using 2D array in Java get 3 subject mark and give result total student are 10
// Using 2D array in Java get 3 subject mark and give result total student are 10
// keep visit for more updates
package ahsan;
import java.util.Scanner;
public class Ahsan {
public static void main(String[] args) {
Scanner obj=new Scanner(System.in);
int sum=0, per=0;
int arry [][]= new int [10][3];
for(int r=0; r<10; r++)
{
System.out.print("\t"+(r+1)+" Student :\n");
for(int c=0; c<3; c++)
{
System.out.print("\t"+(c+1)+" Subject Marks :");
arry[r][c]=obj.nextInt();
sum+=arry[r][c];
}
System.out.println("Total is :"+sum);
per=sum*100/300;
System.out.println("Percenstage is :"+per );
if (per >=80)
{System.out.println(" A Grade");}
else if (per >=65)
{System.out.println("B Grade");}
else if (per >= 50)
{System.out.println("C Grade");}
else if (per >=40)
{System.out.println("D Grade");}
else
{System.out.println("Fail");}
sum=0;
per=0;
}
}
}
Output of this Program this is continue Run 10 times.
// keep visit for more updates
package ahsan;
import java.util.Scanner;
public class Ahsan {
public static void main(String[] args) {
Scanner obj=new Scanner(System.in);
int sum=0, per=0;
int arry [][]= new int [10][3];
for(int r=0; r<10; r++)
{
System.out.print("\t"+(r+1)+" Student :\n");
for(int c=0; c<3; c++)
{
System.out.print("\t"+(c+1)+" Subject Marks :");
arry[r][c]=obj.nextInt();
sum+=arry[r][c];
}
System.out.println("Total is :"+sum);
per=sum*100/300;
System.out.println("Percenstage is :"+per );
if (per >=80)
{System.out.println(" A Grade");}
else if (per >=65)
{System.out.println("B Grade");}
else if (per >= 50)
{System.out.println("C Grade");}
else if (per >=40)
{System.out.println("D Grade");}
else
{System.out.println("Fail");}
sum=0;
per=0;
}
}
}
Output of this Program this is continue Run 10 times.