Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class MarksEntry{
  3. public static void main(String[]args){
  4. Scanner sc=new Scanner(System.in);
  5. int marks [][]=new int[10][4];
  6. //record entry
  7. for(int i=0;i<10;i++){
  8. System.out.println("Enter the record of the student "+i+1);
  9. System.out.print("Roll No= ");
  10. marks[i][0]=sc.nextInt();
  11. System.out.println("Enter the record of the student "+i+1);
  12. System.out.print("Maths= ");
  13. marks[i][1]=sc.nextInt();
  14. System.out.println("Enter the record of the student "+i+1);
  15. System.out.print("Physics= ");
  16. marks[i][2]=sc.nextInt();
  17. System.out.println("Enter the record of the student "+i+1);
  18. System.out.print("Chemistry= ");
  19. marks[i][3]=sc.nextInt();
  20. }
  21. //display
  22. System.out.println("Roll No \t Maths \t Physics \t Chemistry ");
  23. System.out.println("_______ \t _____ \t _______ \t _________");
  24. for(int i=0;i<10;i++){
  25. for(int j=0;j<4;j++){
  26. System.out.print(marks [i][j]+"\t\t");
  27. }
  28.  
  29. System.out.println();
  30. }
  31. System.out.println("The Students who passed are");
  32. System.out.println("Roll No \t Maths \t Physics \t Chemistry");
  33. System.out.println("_______ \t _____ \t _______ \t _________");
  34. for(int i=0;i<10;i++)
  35. {
  36.  
  37. int j=0;
  38. int roll=marks[i][j];
  39.  
  40. j=j+1;
  41. int a= marks[i][j];
  42. j=j+1;
  43. int b= marks[i][j];
  44. j=j+1;
  45. int c= marks[i][j];
  46. if(a>=40 && b>=40 && c>=40)
  47. {
  48. System.out.print(roll+"\t\t"+a+"\t\t"+b+"\t\t"+c);
  49. System.out.println(" ");
  50.  
  51. }
  52.  
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement