0% found this document useful (0 votes)
4 views

Lab Assessment 1 (ArrayList)

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Lab Assessment 1 (ArrayList)

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Department of Computer Science Semester: FALL 2024

UET Lahore, New Campus Roll No:

Lab Assessment 1 Total Marks: 10


CS-261L: Data Structures and Mapping CLOS:
Algorithms Lab
Array List CLO4 Marks Obtained:

==============================================================================================

Levels of Achievement
Exemplary (90-100%) The program demonstrates exceptional quality, correctness, and code organization.
Proficient (80-89%) The program demonstrates good quality, correctness, and code organization, with some minor
issues.
Developing (70-79%) The program demonstrates fair quality, correctness, and code organization, with some notable
issues.
Emerging (Below 70%) The program demonstrates poor quality, correctness, and code organization, with significant issues.

Scenario 1: Library Management System Difficulty level: Easy


Mapping CLOS: CLO1, CLO4 Time: 60 minutes
You are a librarian managing a collection of books. You want to keep track of the books in your library using
an ArrayList.
Write a program to perform the following operations:
1. Add books to the library (e.g., "Harry Potter", "The Lord of the Rings", etc.)
2. Remove books from the library (e.g., "The Hunger Games")
3. Search for a book in the library (e.g., "Is 'Harry Potter' in the library?")
4. Display all books in the library

Example Input/Output:
Input: Output:
- Add "Harry Potter" - Book added: Harry Potter
- Add "The Lord of the Rings" - Book added: The Lord of the Rings
- Add "The Hunger Games" - Book added: The Hunger Games
- Remove "The Hunger Games" - Book removed: The Hunger Games
- Search "Harry Potter" - Book found: Harry Potter
- Display all books - All books: [Harry Potter, The Lord of the Rings]

ArrayList Operations - add (element): Adds a book to the library


(to be used): - remove (element): Removes a book from the library
- contains (element): Searches for a book in the library
- display (): Displays all books in the library

RUBRICS FOR ASSESSING THE LIBRARY MANAGEMENT SYSTEM PROGRAM:


CRITERIA Questions
CORRECTNESS (3 POINTS) 1. Does the program correctly add, remove, and search for books?
2. Are the books displayed correctly?
CODE QUALITY (2 POINTS) 1. Is the code well-organized, readable, and maintainable?
2. Are the variable names and comments clear and descriptive?
ARRAYLIST OPERATIONS (3 1. Are the ArrayList operations (add, remove, contains, display) used
POINTS) correctly?
2. Are the operations efficient and effective?
ERROR HANDLING (2 POINTS) 1. Does the program handle errors and exceptions properly?
2. Are errors and exceptions handled gracefully?
Scenario 2: Student Management System Difficulty level: Medium
Mapping CLOS: CLO1, CLO4 Deadline: 03.09.2024
You are a manager at a university, and you want to keep track of student information using an ArrayList.
Write a program to perform the following operations:
1. Add students to the university (e.g., name, ID, GPA)
2. Remove students from the university (e.g., by ID)
3. Search for a student by ID or name
4. Display all students in the university
5. Calculate the average GPA of all students
6. Find the student with the highest GPA
Example Input/Output:
Input: Output:
- Add student "John Doe" with ID "1234" and GPA 3.5 - Student added: John Doe (1234, 3.5)
- Add student "Jane Smith" with ID "5678" and GPA 3.8 - Student added: Jane Smith (5678, 3.8)
- Remove student with ID "1234" - Student removed: John Doe (1234)
- Search for student with ID "5678" - Student found: Jane Smith (5678, 3.8)
- Display all students - All students: [Jane Smith (5678, 3.8)]
- Calculate average GPA - Average GPA: 3.8
- Find student with highest GPA - Student with highest GPA: Jane Smith (5678, 3.8)

ArrayList Operations - add(element): Adds a student to the university


(to be used): - remove(element): Removes a student from the university
- contains(element): Searches for a student by ID or name
- display(): Displays all students in the university
- Custom methods for calculating average GPA and finding the student with the highest
GPA

NOTE: This example requires more complex ArrayList operations, such as:
- Creating a custom Student class to store student information
- Using ArrayList methods to search and manipulate student data
- Implementing custom methods for calculating average GPA and finding the student with the highest GPA

RUBRICS FOR ASSESSING THE LIBRARY MANAGEMENT SYSTEM PROGRAM:


CRITERIA Questions
CORRECTNESS (3 POINTS) 1. Does the program correctly add, remove, search, and display students?
2. Are the average GPA and highest GPA calculations accurate?
CODE QUALITY (2 POINTS) 1. Is the code well-organized, readable, and maintainable?
2. Are the variable names and comments clear and descriptive?
ARRAYLIST OPERATIONS (2 1. Are the ArrayList operations (add, remove, contains, display) used
POINTS) correctly?
2. Are the operations efficient and effective?
CUSTOM METHODS (1.5 1. Are the custom methods (average GPA, highest GPA) implemented
POINTS) correctly?
2. Are the methods efficient and effective?
ERROR HANDLING (1 POINTS) 1. Does the program handle errors and exceptions properly?
2. Are errors and exceptions handled gracefully?
DOCUMENTATION (0.5 1. Is the program well-documented with comments and explanations?
POINTS) 2. Are the comments clear, concise, and helpful?

You might also like