diff --git a/Bro Code_SY 19/Buffer College - Sheet1(1).csv b/Bro Code_SY 19/Buffer College - Sheet1(1).csv new file mode 100644 index 0000000..b1af7d4 --- /dev/null +++ b/Bro Code_SY 19/Buffer College - Sheet1(1).csv @@ -0,0 +1,11 @@ +College Code,College Name,Computer Filled,Computer Available,ENTC Filled,ENTC Available,IT Filled,IT Available,Total Filled Seats,Total Available Seats,Total seats +2140,Mksss. Cummins College of Engineering for Women Pune,0,60,0,40,0,40,0,140,140 +6142,College of Engineering Pune,0,60,0,40,0,40,0,140,140 +2144,Pune Institute of Technology,0,60,0,40,0,40,0,140,140 +1256,MIT WPU Pune,0,60,0,40,0,40,0,140,140 +1890,Vishwakarma Institute of Technology Pune ,0,60,0,40,0,40,0,140,140 +1566,Veermata Jijabai Technological Institute Mumbai,0,60,0,40,0,40,0,140,140 +3127,Sardar Patel Institute of Technology Mumbai,0,60,0,40,0,40,0,140,140 +9091,Institute of Chemical Technology Mumbai,0,60,0,40,0,40,0,140,140 +4522,DJ Sanghavi Mumbai,0,60,0,40,0,40,0,140,140 +1109,Don Bosco Institute of Technology,0,60,0,40,0,40,0,140,140 \ No newline at end of file diff --git a/Bro Code_SY 19/Buffer Student - Sheet1 (4).csv b/Bro Code_SY 19/Buffer Student - Sheet1 (4).csv new file mode 100644 index 0000000..275ec61 --- /dev/null +++ b/Bro Code_SY 19/Buffer Student - Sheet1 (4).csv @@ -0,0 +1,21 @@ +Student ID,Password,Name,Email ID ,Math Percentile,Physics Percentile,Chemistry Percentile,Total Percentile,Preference 1,Preference 2,Preference 3,Status,PCM_12TH,Freeze,Float,Withdraw +EN2023001,admin123,Nishi Dwivedi,nishidwivedi@gmail.com,98.59,95.9,97.89,97.46,6142 Comp,2140 IT,1890 Comp,0,90.2,0,0,0 +EN2023002,admin123,Traushi Nimje,tarushinimje@gmail.com,99.92,98.95,97.2,98.69,1890 Comp,2144 IT,1256 Comp,0,82.34,0,0,0 +EN2023003,admin123,Akash Sharma,akashsharma@gmail.com,92.23,90.6,79.23,87.35,6142 ENTC,1256 Comp,1256 IT,0,77.5,0,0,0 +EN2023004,admin123,Sakshi Chavan,sakshichavan@gmail.com,95.95,99.2,80.79,91.98,2140 Comp,6142 ENTC,2144 IT,0,95.67,0,0,0 +EN2023005,admin123,Vedantika Jadhav,vedantikajadhav@gmail.com,91.91,90.12,75.39,85.8,2144 ENTC,1256 IT,2140 ENTC,0,83.46,0,0,0 +EN2023006,admin123,Shaina Bhatia,shainabhatia@gmail.com,90.05,85.3,77.69,80.1,1256 Comp,1290 IT,2144 IT,0,89.12,0,0,0 +EN2023007,admin123,Vijay Awatade,vijayawatade@gmail.com,99.4,98.99,99.92,99.5,1566 Comp,3127 Comp,9091 Comp,0,78.12,0,0,0 +EN2023008,admin123,Kavya Sinha,kavyasinha@gmail.com,95.7,92.12,90.34,92.72,1109 ENTC,4522 IT,2144 ENTC,0,90.2,0,0,0 +EN2023009,admin123,Pranaya Warrier,pranayawarrier@gmail.com,89.78,80.12,78.85,82.91,2140 Comp,6142 IT,1566 Comp,0,75.12,0,0,0 +EN2023010,admin123,Arinjay Thakur,arinjaythakur@gmail.com,90.23,89.12,79.9,85.41,1256 Comp,1890 IT,1256 IT,0,79.9,0,0,0 +EN2023011,admin123,Rohit Jaiswal,rohitjaiswal@gmail.com,89.23,67.12,56.78,71.04,1566 ENTC,3127 IT,6142 IT,0,92.23,0,0,0 +EN2023012,admin123,Arya Lende,aryalende@gmail.com,90.45,99.24,99.12,96.47,1256 IT,4522 Comp,1109 Comp,0,94.56,0,0,0 +EN2023013,admin123,Kaiwalya Todkar,kaiwalyatodkar@gmail.com,88.12,68.89,94.23,83.45,2144 Comp,6142 Comp,4522 Comp,0,89.23,0,0,0 +EN2023014,admin123,Gouri Dhampalwar,gouridhampalwar@gmail.com,99.23,89.88,90.45,93.18,2140 Comp,1256 IT,9091 IT,0,80.8,0,0,0 +EN2023015,admin123,Angad Bedi,angadbedi@gmail.com,89.53,30.23,93.12,70.96,1109 Comp,1109 IT,1109 Entc,0,79.45,0,0,0 +EN2023016,admin123,Khushi Sharma,khushisharma@gmail.com,78.89,91.56,93.12,87.85,1566 IT,3127 IT,6142 IT,0,86.78,0,0,0 +EN2023017,admin123,Roselin Vase,roselinvase@gmail.com,97.67,92.13,95.67,95.15,1890 Comp,1566 IT,2144 IT,0,87.45,0,0,0 +EN2023018,admin123,Soham Thorat,sohamthorat@gmail.com,89.12,78.22,89.23,85.53,4522 ENTC,6142 IT,6142 Comp,0,95.56,0,0,0 +EN2023019,admin123,Aaditya Prasade,aadityaprasade@gmail.com,78.45,12.45,90.23,60.37,3127 IT,9091 Comp,6142 IT,0,97.67,0,0,0 +EN2023020,admin123,Devika Maithania,devikamaithania@gmail.com,92.12,90.22,98.12,91.12,1109 ENTC,1566 IT,2144 ENTC,0,90.6,0,0,0 \ No newline at end of file diff --git a/Bro Code_SY 19/Main.java b/Bro Code_SY 19/Main.java new file mode 100644 index 0000000..903112f --- /dev/null +++ b/Bro Code_SY 19/Main.java @@ -0,0 +1,683 @@ +package versionTrial; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + + + + +public class Main +{ + public static void main(String[] args) + { + Scanner input=new Scanner(System.in); + Operations obj=new Operations(); + Allocation obj1=new Allocation(); + + try + { + HashMap hash_student=obj.store_student_data_in_hashmap(); + HashMap hash_college=obj.store_college_data_in_hashmap(); + obj.assign_merit(hash_student); + obj1.insert_in_queue(hash_student); + obj1.allocate_by_preference(hash_college, hash_student); + + + String verified=obj.login(hash_student); + + if(verified!=null) + { + String id=verified; + int choice=0; + while(choice!=4) + { + System.out.println("\n*****MENU*****"); + System.out.println("1)Change Password"); + System.out.println("2)View & Confirm Allocation"); + System.out.println("3)Update Preferences"); + System.out.println("4)Exit"); + + + + System.out.print("Enter Choice: "); + choice=input.nextInt(); + + switch(choice) + { + + case 1://change password + boolean correct_pass=false; + while(correct_pass!=true) + { + System.out.print("\nEnter Old Password: "); + String pass= input.next(); + try + { + if(hash_student.get(id).password.equals(pass)) + { + correct_pass=true; + boolean correct_newpass=false; + while(correct_newpass!=true) + { + System.out.print("Enter new Password: "); + String new_pass=input.next(); + System.out.print("Re-enter new Password: "); + String confirm_pass=input.next(); + if(confirm_pass.equals(pass)) + { + System.out.println("\nNew password cannot be the same as old password!"); + } + else if(new_pass.equals(confirm_pass)) + { + correct_newpass=true; + hash_student.get(id).password=new_pass; + System.out.println("\nPassword changed successfully!"); + } + + } + } + else + { + System.out.println("Enter Correct Password!"); + } + + + } + catch(Exception e) + { + System.out.println("Invalid UserID!"); + } + } + break; + + + case 2://view and confirm allocation + int alloted=hash_student.get(id).Status; + + switch(alloted) + { + case 1: + String pref[]=hash_student.get(id).preference1.split(" "); + System.out.print("\nYou have been allotted "); + System.out.print("College: "+hash_college.get(Integer.parseInt(pref[0])).Name+" ,"); + System.out.print("Branch: "+pref[1]); + obj1.ffw(id, hash_student,1); + break; + + case 2: + pref= hash_student.get(id).preference2.split(" "); + System.out.print("\nYou have been allotted "); + System.out.print("College: "+hash_college.get(Integer.parseInt(pref[0])).Name+" ,"); + System.out.print("Branch: "+pref[1]); + obj1.ffw(id, hash_student,2); + break; + + case 3: + pref= hash_student.get(id).preference3.split(" "); + System.out.print("\nYou have been allotted "); + System.out.print("College: "+hash_college.get(Integer.parseInt(pref[0])).Name+" ,"); + System.out.print("Branch: "+pref[1]); + obj1.ffw(id, hash_student,3); + break; + + default: + System.out.println("No College Allotted, Wait for next Round"); + + } + break; + + + case 3://Update Preferences + System.out.println("\n College Code \t\t College"); + for(int j=0;j store_student_data_in_hashmap() + { + + HashMap Student_data= new HashMap<>(); + //Student_data.put(id,obj); + try + { + File file = new File("enter file path"); + FileReader fr = new FileReader(file); + BufferedReader br = new BufferedReader(fr); + String line = ""; + String[] tempArr; + int i=0; + while((line = br.readLine()) != null) + { + if(i!=0) + { + Student obj=new Student(); + tempArr = line.split(","); + obj.id=tempArr[0]; + obj.password=tempArr[1]; + obj.Name=tempArr[2]; + obj.email=tempArr[3]; + obj.math_percentile=Float.parseFloat(tempArr[4]); + obj.physics_percentile=Float.parseFloat(tempArr[5]); + obj.chemistry_percentile=Float.parseFloat(tempArr[6]); + obj.total_percentile=Float.parseFloat(tempArr[7]); + obj.preference1=tempArr[8]; + obj.preference2=tempArr[9]; + obj.preference3=tempArr[10]; + obj.Status=Integer.parseInt(tempArr[11]); + obj.PCM_12TH=Float.parseFloat(tempArr[12]); + obj.freeze=Integer.parseInt(tempArr[13]); + obj.floate=Integer.parseInt(tempArr[14]); + obj.withdraw=Integer.parseInt(tempArr[15]); + Student_data.put(obj.id,obj); + } + + i++; + + } + br.close(); + } + catch(IOException e1) + { + + } + + return Student_data; + } + + + String login(HashMap Student_data ) throws IOException + { + Scanner sc= new Scanner(System.in); + String a=null; + int choice=0; + System.out.println("MENU"); + System.out.println("1. Student Login"); + System.out.println("2. Exit"); + + System.out.print("Enter your choice:"); + choice=sc.nextInt(); + switch(choice) + { + case 1: + boolean correct=false; + while(correct==false ) + { + System.out.print("\nEnter UserID: "); + String id=sc.next(); + String text1=Student_data.get( id).password; + System.out.print("Enter Password: "); + String pass= sc.next(); + + if(text1.equals(pass)) + { + correct=true; + a=id; + break; + + } + else + { + System.out.println("Wrong Password!"); + System.out.println("Re-enter UserId and Password: "); + //correct=false; + } + } + break; + + case 2: + choice=2; + break; + + } + return a; + } + + + + + + + HashMap store_college_data_in_hashmap() + { + + HashMap College_data = new HashMap<>(); + + try + { + File file = new File("D:\\Pradnya\\Downloads\\Buffer College - Sheet1.csv"); + FileReader fr = new FileReader(file); + BufferedReader br = new BufferedReader(fr); + String line = ""; + String[] tempArr; + int i=0; + while((line = br.readLine()) != null) + { + if(i!=0) + { + College obj=new College(); + tempArr = line.split(","); + obj.Code=Integer.parseInt(tempArr[0]); + obj.Name=tempArr[1]; + obj.Comp_filled=Integer.parseInt(tempArr[2]); + obj.Comp_Available=Integer.parseInt(tempArr[3]); + obj.ENTC_filled=Integer.parseInt(tempArr[4]); + obj.ENTC_Available=Integer.parseInt(tempArr[5]); + obj.IT_filled=Integer.parseInt(tempArr[6]); + obj.IT_Available=Integer.parseInt(tempArr[7]); + obj.total_filled=Integer.parseInt(tempArr[8]); + obj.total_available=Integer.parseInt(tempArr[9]); + obj.Total_Seats=Integer.parseInt(tempArr[10]); + College_data.put(obj.Code,obj); + } + + i++; + + } + br.close(); + } + catch(IOException e1) + { + + } + return College_data; + + } + + + void assign_merit(HashMap Student_data) + { + Student[] array=new Student[Student_data.size()]; + for(int j=0;j(array[k+1].total_percentile)) + { + Student obj=array[k]; + array[k]=array[k+1]; + array[k+1]=obj; + } + else if((array[k].total_percentile)==(array[k+1].total_percentile)) + { + if((array[k].math_percentile)>(array[k+1].math_percentile)) + { + Student obj=array[k]; + array[k]=array[k+1]; + array[k+1]=obj; + } + else if((array[k].math_percentile)==(array[k+1].math_percentile)) + { + if((array[k].physics_percentile)>(array[k+1].physics_percentile)) + { + Student obj=array[k]; + array[k]=array[k+1]; + array[k+1]=obj; + } + else if((array[k].physics_percentile)==(array[k+1].physics_percentile)) + { + if((array[k].chemistry_percentile)>(array[k+1].chemistry_percentile)) + { + Student obj=array[k]; + array[k]=array[k+1]; + array[k+1]=obj; + } + else if((array[k].chemistry_percentile)==(array[k+1].chemistry_percentile)) + { + if((array[k].HSC_PCM)>(array[k+1].HSC_PCM)) + { + Student obj=array[k]; + array[k]=array[k+1]; + array[k+1]=obj; + } + else if((array[k].HSC_PCM)==(array[k+1].HSC_PCM)) + { + //do nothing, asude tasach + } + } + } + } + } + } + } + + + for(int k=0;k queue = new PriorityQueue(1000, new MyComparator()); + + + void insert_in_queue(HashMap Student_data) + { + for(int i=0;i College_data,HashMap Student_data) + { + Operations obj=new Operations(); + + while (!queue.isEmpty()) + { + Student student=queue.poll(); //student is removed from queue after allocation, new queue will be created for new round + String id=student.id; + + String pref1[]=student.preference1.split(" "); + String pref2[]=student.preference2.split(" "); + String pref3[]=student.preference3.split(" "); + + + if (allocate(pref1[1],College_data,Integer.parseInt(pref1[0]))==1) + { + //first preference alloted therefore change status to 1 + Student_data.get(id).Status=1; + } + + else if (allocate(pref2[1],College_data,Integer.parseInt(pref2[0]))==1) + { + //second preference alloted therefore change status to 2 + Student_data.get(id).Status=2; + } + + else if (allocate(pref3[1],College_data,Integer.parseInt(pref3[0]))==1) + { + //third preference alloted therefore change status to 3 + Student_data.get(id).Status=3; + } + + else + { + System.out.println("No College allotted!"); + //student still removed from queue, can be added for next round + } + + } + } + + + + int allocate(String branch,HashMap College_data,int college_code) + { + boolean flag=false; + switch(branch) + { + case "COMP": + if(College_data.get(college_code).Comp_Available!=0) + { + College_data.get(college_code).Comp_Available--; + College_data.get(college_code).Comp_filled++; + flag=true; + } + break; + + case "ENTC": + if(College_data.get(college_code).ENTC_Available!=0) + { + College_data.get(college_code).ENTC_Available--; + College_data.get(college_code).ENTC_filled++; + flag=true; + } + break; + + case "IT": + if(College_data.get(college_code).IT_Available!=0) + { + College_data.get(college_code).IT_Available--; + College_data.get(college_code).IT_filled++; + flag=true; + } + break; + + } + if(flag==true) + { + //implies preference was alloted + return 1; + } + else + { + return 0; + } + } + + + + void ffw(String id,HashMap Student_data,int preference) + { + Scanner sc = new Scanner(System.in); + System.out.println("\nDo you want to Freeze, Float or Withdraw?"); + System.out.println("1. Freeze"); + System.out.println("2. Float"); + System.out.println("3. Withdraw"); + System.out.print("Option: "); + int ch = sc.nextInt(); + switch (ch) { + case 1: + if(Student_data.get(id).freeze==0) + { + switch(preference) + { + case 1: + System.out.println("Your allocation for " + Student_data.get(id).preference1 + " is frozen"); + break; + + case 2: + System.out.println("Your allocation for " + Student_data.get(id).preference2 + " is frozen"); + break; + + case 3: + System.out.println("Your allocation for " + Student_data.get(id).preference3 + " is frozen"); + break; + } + Student_data.get(id).freeze = 1; + + } + else + { + System.out.println("Seat already frozen!"); + } + break; + + + + case 2: + if(Student_data.get(id).floate ==0) + { + switch(preference) + { + case 1: + System.out.println("Your allocation for " + Student_data.get(id).preference1 + " is floated"); + break; + + case 2: + System.out.println("Your allocation for " + Student_data.get(id).preference2 + " is floated"); + break; + + case 3: + System.out.println("Your allocation for " + Student_data.get(id).preference3 + " is floated"); + break; + } + Student_data.get(id).floate = 1; + } + else + { + System.out.println("Seat already floated!"); + } + + break; + + + case 3: + System.out.println("Your application is withdrawn, no seat will be allotted"); + Student_data.get(id).withdraw =1; + break; + + default: + System.out.println("Invalid choice"); + return; + } + + } +} + + +class MyComparator implements Comparator +{ + public int compare(Student student1, Student student2) + { + // We are returning the object in descending order of their merit + if (student1.merit_number < student2.merit_number) + return 1; + else if (student1.merit_number > student2.merit_number) + return -1; + return 0; + } +} + + + diff --git a/Buffer 4.0.pdf b/Buffer 4.0.pdf new file mode 100644 index 0000000..27100ae Binary files /dev/null and b/Buffer 4.0.pdf differ diff --git a/Buffer_Report1.docx b/Buffer_Report1.docx new file mode 100644 index 0000000..45ba1cf Binary files /dev/null and b/Buffer_Report1.docx differ diff --git a/Buffer_Report2.docx b/Buffer_Report2.docx new file mode 100644 index 0000000..b451423 Binary files /dev/null and b/Buffer_Report2.docx differ diff --git a/Project Demo b/Project Demo new file mode 100644 index 0000000..a67b77f --- /dev/null +++ b/Project Demo @@ -0,0 +1,2 @@ +Project Video +https://drive.google.com/file/d/1GceW0fXaypwekR2ee-sS3tUok9_g_OrZ/view?usp=sharing diff --git a/README.md b/README.md index e6bc571..acedc5a 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,11 @@ # Buffer-4.0 -Buffer is a Data Structures and Algorithms Project series, in which students can participate as mentees in teams of 3-4 people. -This year the themes on which students can create a project are- - -1. Healthcare -2. Digital Society -3. Open Innovation -4. Custom data structure to store data - -This repository is created for all the teams to be able to upload their final project source code for the same. - -While submitting, note that: - -Each folder should have the name of the team and inside a readme file with team member details, (name, year, branch) and their theme. The readme file should also contain the link to their presentation as well as the drive link where both the report documents would be stored. - -Happy Coding :) +Team Name--- BRO CODE +Theme:= Digital Society +Team Members +Pradnya Apte (SY COMP) +Rajasi Barapatre(SY COMP) +Sanika Chavan(SY COMP) + Arya Deshmukh(SY COMP) + + Project Name:= + College Allocation diff --git a/Readme2.md b/Readme2.md new file mode 100644 index 0000000..68ae320 --- /dev/null +++ b/Readme2.md @@ -0,0 +1,50 @@ +=======================================OBJECTIVE=================================== + +The objective of a college allocation system in Java is to automate the process of allocating colleges to students based on their preferences, available seats and merit. This system can be used by educational institutions to simplify the admission process and reduce the workload of manual allocation. + +The system can take input from students about their preferences for colleges, such as the location, along with their academic records. The system can also collect information about the available colleges and their admission criteria, such as cut-off marks, number of seats, etc. + +Based on this information, the system can use algorithms and rules to match students with colleges. The system can also generate reports and notifications to inform students about the status of their allocation, such as whether they have been selected for a college, waitlisted, or rejected. + +Overall, the objective of a college allocation system in Java is to provide a transparent and efficient allocation process for both students and educational institutions. + + +===================================FUNCTIONALITY========================================= + +A college allocation system in Java typically consists of several components that work together to allocate colleges to students based on their preferences and merit. Here are the key functionalities of a typical college allocation system: + +1. Registration and Login: The system should allow students to register with their personal and academic details, and create a login for future access. + +2. College Information: The system should provide detailed information about the colleges, such as their location, courses offered, facilities, admission criteria, etc. + +3. Preference Input: The system should allow students to input their preferences for colleges, such as the preferred courses, and facilities. + +4. Merit Evaluation: The system should evaluate the merit of students based on their academic records and other relevant factors. + +5. Allocation Algorithm: The system should use algorithms and rules to match students with colleges based on their preferences and merit. + +6. Allocation Results: The system should generate reports and notifications to inform students about the status of their allocation, such as whether they have been selected for a college, waitlisted, or rejected. + +7. Waitlist Management: The system should manage the waitlist of students and reallocate colleges to them in case of any cancellations or withdrawals. + +Overall, the college allocation system in Java should provide a transparent and efficient allocation process for both students and educational institutions. + +=========================================FUTURE SCOPE============================ + +The college allocation system in Java has a wide scope for future development and enhancements. Here are some potential areas of growth and innovation for this system: + +1. Machine Learning and AI: The college allocation system can be enhanced using machine learning and AI techniques to improve the allocation algorithm and better match students with colleges based on their preferences and merit. + +2. Mobile Application: The system can be developed as a mobile application to make it more accessible and convenient for students to use. + +3. Blockchain Technology: The use of blockchain technology can help to improve the security and transparency of the allocation process. + +4. Integration with Learning Management Systems: The system can be integrated with Learning Management Systems (LMS) to streamline the admission and enrollment process and provide a seamless experience for students. + +5. Personalized Recommendations: The system can be enhanced to provide personalized recommendations to students based on their academic records, interests, and career goals. + +6. Virtual Campus Tours: The system can be integrated with virtual campus tours to provide students with a better understanding of the colleges and their facilities. + +7. Real-time Updates: The system can be enhanced to provide real-time updates to students about their allocation status, waitlist status, and any changes in the allocation process. + +Overall, the future scope of the college allocation system in Java is vast and exciting, with many opportunities for innovation and growth.