Exam Seating Arrangement System in Java [message #1848849] |
Tue, 21 December 2021 05:45 |
Aarti Yadav Messages: 5 Registered: August 2020 |
Junior Member |
|
|
Hello All, I am working on java project and I want to know the source code of Exam Seating Arrangement System Project. Basically, There are primarily two entities, the admin and the student. Both entities can log in and register to the system, check and access the system as per the approval granted to them. The admin can see all the relevant details of the students and provide the input to the system taking into consideration the need like the branch, semester, year, subject of the student. Admin will input details like the total students, available classes with the number of seats, etc. After gathering all this information the system will generate a seating arrangement based on the row number and the students' roll number. and I have taken this reference from here https://www.interviewbit.com/blog/java-projects/ Can anyone provide me the source code of the exam seating arrangement system?
|
|
|
|
Re: Exam Seating Arrangement System in Java [message #1858371 is a reply to message #1848849] |
Fri, 31 March 2023 08:17 |
Gulshan Negi Messages: 5 Registered: December 2021 |
Junior Member |
|
|
You can try this Java Program:
import java.util.*;
public class ExamSeatingArrangement {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Prompt the user to enter the number of students
System.out.print("Enter the number of students: ");
int numStudents = sc.nextInt();
// Prompt the user to enter the number of rows and columns
System.out.print("Enter the number of rows: ");
int numRows = sc.nextInt();
System.out.print("Enter the number of columns: ");
int numCols = sc.nextInt();
// Calculate the total number of seats available
int numSeats = numRows * numCols;
// Check if there are enough seats for all the students
if (numStudents > numSeats) {
System.out.println("There are not enough seats for all the students!");
return;
}
// Create a 2D array to represent the seating arrangement
int[][] seatingArrangement = new int[numRows][numCols];
// Assign seats to students
int studentNumber = 1;
for (int i = 0; i < numRows; i++) {
for (int j = 0; j < numCols; j++) {
if (studentNumber <= numStudents) {
seatingArrangement[i][j] = studentNumber;
studentNumber++;
}
}
}
// Print the seating arrangement
System.out.println("Seating Arrangement:");
for (int i = 0; i < numRows; i++) {
for (int j = 0; j < numCols; j++) {
if (seatingArrangement[i][j] == 0) {
System.out.print(" ");
} else {
System.out.printf("%2d", seatingArrangement[i][j]);
}
}
System.out.println();
}
}
}
Hope this code will help you, found program on the internet, you can check the source code herehttps://www.techgeekbuzz.com/blog/java-projects/
[Updated on: Fri, 31 March 2023 08:21] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03014 seconds