Programming Fundamentals Project: Faculty of Information Technology UCP Lahore Pakistan
Programming Fundamentals Project: Faculty of Information Technology UCP Lahore Pakistan
Project
Note:
• This is an individual Project.
• You have to perform only one question among the three.
• Each question carries equal marks.
• 100 % marks will be given on the basis of No Memory leakage, No dangling pointers, and No
extra space should be wasted. Also make use of helper functions where ever required.
• String data type not allowed instead use CString with null termination else you will get 0.
• Only Students without any plagiarism will be given a favor of 3 bonus marks in the project and
in one of the instrument after mid in lab.
• Submission will be on portal in Lab under folder named Project_Submissions.
Question 1: “Pestcouts” is an emerging pesticide (insect killer) research lab. They are aiming at
producing environmental friendly pesticides. Currently they are conducting tests for a new formula on a
farmhouse. They divided the farmhouse into 4 fields. They have conducted a test and record the success
scores. Scores are sent to the system one by one and stored in a table as shown below.
In the below data table, tests are being conducted in 4 fields. Each field corresponds to row and each test
value corresponds to column of data.
Field 1 5 1 21 -1 -1 -1
Field 2 -1 -1 -1 -1 -1 -1
Field 3 23 5 20 5 30 -1
Field 4 1 9 5 0 -1 -1
• Enter choice: 5
Field1 average: 9
Field2 average: empty field
Field3 average: 16.6
Field4 average: 2.5
Expected Output 2:
• Enter choice: 6
Field3 has the maximum success score.
Expected Output 3:
• Enter choice: 2
There are 12 test score values entered in table.
Expected Output 4:
• Enter choice: 1
Enter the field in which you want to enter a value: 1
Enter the value you want to enter: 12
Field 1 5 1 21 12 -1 -1
Field 2 -1 -1 -1 -1 -1 -1
Field 3 23 5 20 5 30 -1
Field 4 1 9 5 0 -1 -1
OR
Question 2: Your task is to design a departmental store management system. The store has multiple
shelves with numbers on it for placing multiple items, initially the shelf is empty, means that there is no
item on the shelf. The store consists of k number of shelves, and each shelf has exactly p number of
positions for items to be placed on it. The store wants to design a software to keep the records of item
on the shelves. The software should be able to perform the following operations:
1. Insert the item at a particular position in a given shelf, if it’s empty else place the item in the first
empty location in that shelf, and if there is no location empty on that shelf then do not insert it
and display the appropriate message to the user.
2. Display all the items in a given shelf.
3. Remove the item from particular position in a given shelf if it is there.
4. Remove all the item from a given shelf
5. Return total number of the items in the specified shelf
6. Return the total number of items in all the shelves.
7. Find item in the store and return the shelf number and its position if it exists.
8. Update the item at given position (can be empty or filled) by replacing it with the new item.
9. Check if the shelf is empty
10. Check if the shelf is full
Your process will start for asking number of shelves (k) and (p) positions on each shelf (Each shelf
can have varying storage positions)
Sample Input/Output:
• Enter no of shelves: 2
• Enter no of positions on each shelf: 4
• Enter Choice: 1
Enter Shelf: 1 Enter Position: 1
Enter Item: Glass
Added successfully!
• Enter Choice: 1
Enter Shelf: 1 Enter Position: 2
Enter Item: Bag
Added successfully!
• Enter Choice: 1
Enter Shelf: 2 Enter Position: 1
Enter Item: Biscuit Box
Added successfully!
• Enter Choice: 5
Total no of items: 3
• Enter Choice: 6
Enter item name to find: Bag
Item found at: Shelf: 1 Position: 2
• Enter Choice: 7
Enter shelf no to update: 3
Error! Shelf not found.
• Enter Choice: 7
Enter shelf no to update: 2 Enter position: 1
Enter item to update with: Bottle
Shelf updated!
• Enter Choice: 3
Enter shelf no to remove item: 1 Enter position: 2
Item removed!
• Enter Choice: 9
Enter shelf no: 2
Shelf 2 is not full.
• Enter Choice: 4
All items removed from every shelf!
• Enter Choice: 8
Enter shelf no: 1
Shelf 1 is empty.
• Enter Choice: 0
Thank you!
OR
Question 3: A University has a Computer Science department in which a Student can enroll
himself/herself in different number of courses. There are total of 5 courses with minimum 3 credit hours
and maximum 4 credit hours. The Department decided to keep the records of student enrollment in a
course along with the section. A student can enroll himself in multiple courses and in multiple section
but he/she can’t study the same course with multiple section.
There is a file containing information related to course code and the credit hours of that course
separated with a space.
There are total of 5 sections Name as A, B C, D, E
Courses.txt
• CSCP1011 4 // Programming Fundamentals
• CSHU2833 3// Logical Thinking
• CSCS2533 3// Digital Logic Design
• CSHU1893 3//Pakistan Studies
• CSSS1713 3//Calculus 1
Define the necessary data types or representing this diagram. The software you design should support
the following functions:
1. Enroll a student by asking student id and display a list of subjects with credit hours offered and
ask him to choose the course, and the section and save the student id, course code, credit hours
and Section name in an array if the student is not already enrolled in that particular course in
any of the section else display error message. (Note A single row of an array should be
containing just single course information, if user has enrolled in multiple courses then multiple
rows will be occupied).
2. A student may drop a specified course. The particular record should be deleted from the array
3. List all the courses in which a particular student is enrolled.
4. Update the Course section in which a student is already enrolled.
5. Display total number of students enrolling in a specified course
6. Display the course which is not enrolled by any of the student
7. Search the student with minimum number of courses registered.
Sample Input/Output:
********** Menu **********
• Enter Choice: 1
Enter Student ID: Bscs0025
• Enter Choice: 1
Enter Student ID: Bscs0178
• Enter Choice: 2
Enter Student ID: Bscs0025
Enter Course Code: CSHU2833
Course dropped successfully!
• Enter Choice: 2
Enter Student ID: Bscs1225
Enter Course Code: CSHU2833
Student is not registered in this course!
• Enter Choice: 3
Enter Student ID: Bscs1225
• CSCP1011 4 Section A
• CSHU2833 3 Section A
• CSCS2533 3 Section C
• CSHU1893 3 Section B
• CSSS1713 3 Section D
• Enter Choice: 4
Enter Student ID: Bscs0447
Enter Course Code: CSHU2833
Enter the New Section: D
Section is Updated Successfully!
• Enter Choice: 4
Enter Student ID: Bscs0347
Enter Course Code: CSHU2833
Enter the New Section: C
Student is not enrolled in this course!
• Enter Choice: 5
Enter Course Code: CSHU2833
Total enrolled students for this course are: 32
• Enter Choice: 6
CSHU2833 is not enrolled by any student
• Enter Choice: 6
No course found
• Enter Choice: 7
BSCS0245 has registered only 2 courses