Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class MarksEntry{
- public static void main(String[]args){
- Scanner sc=new Scanner(System.in);
- int marks [][]=new int[10][4];
- //record entry
- for(int i=0;i<10;i++){
- System.out.println("Enter the record of the student "+i+1);
- System.out.print("Roll No= ");
- marks[i][0]=sc.nextInt();
- System.out.println("Enter the record of the student "+i+1);
- System.out.print("Maths= ");
- marks[i][1]=sc.nextInt();
- System.out.println("Enter the record of the student "+i+1);
- System.out.print("Physics= ");
- marks[i][2]=sc.nextInt();
- System.out.println("Enter the record of the student "+i+1);
- System.out.print("Chemistry= ");
- marks[i][3]=sc.nextInt();
- }
- //display
- System.out.println("Roll No \t Maths \t Physics \t Chemistry ");
- System.out.println("_______ \t _____ \t _______ \t _________");
- for(int i=0;i<10;i++){
- for(int j=0;j<4;j++){
- System.out.print(marks [i][j]+"\t\t");
- }
- System.out.println();
- }
- System.out.println("The Students who passed are");
- System.out.println("Roll No \t Maths \t Physics \t Chemistry");
- System.out.println("_______ \t _____ \t _______ \t _________");
- for(int i=0;i<10;i++)
- {
- int j=0;
- int roll=marks[i][j];
- j=j+1;
- int a= marks[i][j];
- j=j+1;
- int b= marks[i][j];
- j=j+1;
- int c= marks[i][j];
- if(a>=40 && b>=40 && c>=40)
- {
- System.out.print(roll+"\t\t"+a+"\t\t"+b+"\t\t"+c);
- System.out.println(" ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement