Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package SchoolManagement;
- import java.io.*;
- import java.util.*;
- import SchoolManagement.Student;
- public class SchoolStudent{
- public static Student StudentDetails(){
- System.out.println(" ");
- System.out.println(" REGESTRATION DETAILS ");
- System.out.println(" ");
- System.out.println("..Students are needed to fulfill the entire form for successfull regestration........");
- System.out.println(" ");
- System.out.println(" ");
- System.out.println("NAME:");
- Console N=System.console();
- String d1=N.readLine();
- System.out.println(" ");
- System.out.println("CLASS:(ENTER CLASS IN NUMERIC)");
- Console C=System.console();
- String d7=C.readLine();
- int l1=Integer.parseInt(d7);
- System.out.println(" ");
- System.out.println("ROLLNO:(ENTER ROLLNO IN NUMERIC)");
- Console R=System.console();
- String d8=R.readLine();
- int l2=Integer.parseInt(d8);
- System.out.println(" ");
- System.out.println("PASSWORD:(ENTER PASSWORD IN MAX UPTO 6 CHARACTER)");
- Console S=System.console();
- char[] d9=S.readPassword();
- System.out.println(" ");
- System.out.println(" Congratulations your regestration has been successfully done");
- Student s=new Student(d1,l1,l2,d9);
- return s;
- }
- public static void login(HashSet m2){
- System.out.println("USERNAME:");
- Console N1=System.console();
- String M1=N1.readLine();
- System.out.println("PASSWORD");
- Console S2=System.console();
- char[] Z9=S2.readPassword();
- Iterator r1=m2.iterator();
- while(r1.hasNext())
- {
- Object v7=r1.next();
- Student v8=(Student)v7;
- if(M1.equals(v8.Name))
- {
- for(int y=0;y<Z9.length;y++)
- {
- if(Z9[y]!=v8.Password[y])
- {
- System.out.println("Incorrect password");
- return;
- }
- }
- System.out.println("CORRECT PASSWORD");
- v8.display();
- System.out.println(" ");
- System.out.println(" ");
- System.out.println(" ");
- System.out.println("U want to see the details of already regestered student :PRESS YES");
- Console N6=System.console();
- String M6=N6.readLine();
- if(M6.equals("YES"))
- {
- Iterator r4=m2.iterator();
- while(r4.hasNext())
- {
- Object v3=r4.next();
- Student v10=(Student)v3;
- v10.display();
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement