0% found this document useful (0 votes)
2 views5 pages

PF Lab Report

The document outlines a Java-based University Management System that allows users to add students, view details, enroll in courses, and manage course registrations. It describes the system's functionality, data structures used, and the code's strengths, emphasizing its user-friendly menu and error handling. The report concludes that this project serves as a solid foundation for learning Java programming, with suggestions for future improvements.

Uploaded by

fz565916
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

PF Lab Report

The document outlines a Java-based University Management System that allows users to add students, view details, enroll in courses, and manage course registrations. It describes the system's functionality, data structures used, and the code's strengths, emphasizing its user-friendly menu and error handling. The report concludes that this project serves as a solid foundation for learning Java programming, with suggestions for future improvements.

Uploaded by

fz565916
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

COMSATS UNIVERSITY

ISLAMABAD ATTOCK CAMPUS

DEPARTMENT OF COMPUTER
SCIENCE

COURSE PF Lab Report


INSTRUCTOR Sir Tahir Ahmed

STUDENT DETAILS

NAME REGISTRATION NO.


Samra Fatima FA24-BAI-022
Fatima Zahra FA24-BAI-006
University Management System
Introduction
This report explains your Java code for a simple University Management System.
• Add students
• See student details
• Enroll students in courses
• Remove students from courses
• View available courses

How the System Works (Overview)


It uses a main menu that keeps popping up on your screen, asking what you want to do. You
type in a number for your choice (like 1 to add a student, 6 to exit), and the system does what
you asked. It uses a Scanner to read your input.

How Information is Stored (Data Structures)


It uses simple lists, called arrays, to keep track of everything.

• studentIDs: A list to hold the unique ID numbers for up to 10 students.


• studentNames: A list to hold the names of those 10 students, matching their IDs.
• studentAddresses: A list for the addresses of those 10 students, also matching their
IDs.

• enrolledCourses: This is a slightly bigger list (a 2D array). It means for each of the 10
students, you can list up to 5 courses they are signed up for.

• totalStudents: A simple counter that tells the system how many students are
currently stored.

• courseList: A fixed list of all the courses the university offers (like "CS101," "MATH201,"
etc.).
What Each Part of the Code Does:
The Main Program (main)
• What it Does: This is where the program starts and keeps the main menu running.
• How it Works: It keeps showing the main menu, takes the user's choice, and runs the
correct function. If the input is wrong, it shows an error without crashing. Choosing
"Exit" closes the program properly.

Add a Student (addStudent)


• What it Does: Puts a new student's information into the system.
• How it Works: If there's space, the program makes a unique ID, takes the student's
name and address, saves the info, updates the student count, and shows a success
message.

See All Students (viewStudents)


• What it Does: Displays a list of every student and their details.
• How it Works: If students exist, it prints a clear heading. Then, it goes through each
student one by one, showing their ID, name, address, and all the classes they are
currently taking.

Enroll in a Class (enrollCourse)


• What it Does: Allows a student to sign up for a class.
• How it Works: It asks for the Student ID. If not found, it shows "Student not found."
Then it displays available courses. After the user enters a course code:
• If there's space, the course is added.

• If already enrolled, it shows a message.

• If 5-course limit is reached, it warns the user.

Drop a Class (dropCourse)


• What it Does: Allows a student to un-enroll from a course.
• How it Works: It asks for the Student ID and course code to remove. If the course is
found in the student's list, it's removed. If not, it shows a message saying the course
wasn't found.
See Class List (viewCourseList)
• What it Does: Simply shows all the classes the university offers.
• How it Works: It prints a heading and then lists each course code from the courseList.

Find Student's Spot (findStudentIndex)


• What it Does: This is a helper function that quickly finds where a student's information is
located in the lists, using their ID.
• How it Works: It looks through all student IDs. If it finds a match, it gives the position (or
"index") of that student. If not, it returns -1, which means the student wasn't found.

Make Student ID (generateStudentID)


• What it Does: Creates a new, random-like ID number for a student.
• How it Works: It generates IDs that look like "STU" followed by a random number,
specifically between 100 and 189 (e.g., "STU123").

Strengths of the Code:


• Easy Menu: The main menu is clear and simple to use.
• Works Well: All main features like adding, viewing, enrolling, and dropping students
work properly.
• Handles Mistakes: If the user types something wrong (like letters instead of numbers),
the program doesn’t crash. It shows a message instead.
• Smart Course Rules:
• Students can't take more than 5 courses.
• They can’t enroll in the same course twice.
• Simple Design: It uses arrays to store data, which is easy to manage for a small system.
Conclusion:
This University Management System is a good starting project for learning Java. It lets users add
students, enroll or drop courses, and view details through a simple menu. The code uses arrays
to store information and handles basic input errors so the program doesn’t crash. It also shows
how to use methods, loops, and switch statements effectively. In the future, the system can be
improved by using objects, dynamic lists, and better input checks. Overall, it’s a clear and
helpful project for building Java skills.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy