Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. package SchoolManagement;
  2. import java.io.*;
  3. import java.util.*;
  4. import SchoolManagement.Student;
  5. public class SchoolStudent{
  6.  
  7. public static Student StudentDetails(){
  8. System.out.println(" ");
  9. System.out.println(" REGESTRATION DETAILS ");
  10. System.out.println(" ");
  11. System.out.println("..Students are needed to fulfill the entire form for successfull regestration........");
  12. System.out.println(" ");
  13. System.out.println(" ");
  14. System.out.println("NAME:");
  15. Console N=System.console();
  16. String d1=N.readLine();
  17. System.out.println(" ");
  18. System.out.println("CLASS:(ENTER CLASS IN NUMERIC)");
  19. Console C=System.console();
  20. String d7=C.readLine();
  21. int l1=Integer.parseInt(d7);
  22. System.out.println(" ");
  23. System.out.println("ROLLNO:(ENTER ROLLNO IN NUMERIC)");
  24. Console R=System.console();
  25. String d8=R.readLine();
  26. int l2=Integer.parseInt(d8);
  27. System.out.println(" ");
  28. System.out.println("PASSWORD:(ENTER PASSWORD IN MAX UPTO 6 CHARACTER)");
  29. Console S=System.console();
  30. char[] d9=S.readPassword();
  31. System.out.println(" ");
  32. System.out.println(" Congratulations your regestration has been successfully done");
  33. Student s=new Student(d1,l1,l2,d9);
  34. return s;
  35. }
  36. public static void login(HashSet m2){
  37. System.out.println("USERNAME:");
  38. Console N1=System.console();
  39. String M1=N1.readLine();
  40. System.out.println("PASSWORD");
  41. Console S2=System.console();
  42. char[] Z9=S2.readPassword();
  43. Iterator r1=m2.iterator();
  44. while(r1.hasNext())
  45. {
  46. Object v7=r1.next();
  47. Student v8=(Student)v7;
  48.  
  49. if(M1.equals(v8.Name))
  50. {
  51.  
  52. for(int y=0;y<Z9.length;y++)
  53. {
  54. if(Z9[y]!=v8.Password[y])
  55. {
  56. System.out.println("Incorrect password");
  57.  
  58. return;
  59. }
  60. }
  61. System.out.println("CORRECT PASSWORD");
  62. v8.display();
  63. System.out.println(" ");
  64. System.out.println(" ");
  65. System.out.println(" ");
  66. System.out.println("U want to see the details of already regestered student :PRESS YES");
  67. Console N6=System.console();
  68. String M6=N6.readLine();
  69. if(M6.equals("YES"))
  70. {
  71. Iterator r4=m2.iterator();
  72. while(r4.hasNext())
  73. {
  74. Object v3=r4.next();
  75. Student v10=(Student)v3;
  76. v10.display();
  77. }
  78. }
  79. }
  80.  
  81.  
  82.  
  83. }
  84.  
  85. }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement