Assignment 3

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

CE101T – Object Oriented Programming

Section: Assignment # 3 Total marks: 35

Name : __________________ Roll number : __________________

Submission:
• Email instructor or TA if there are any questions. You cannot look at others’ solutions or use
others’ solutions, however, you can discuss it with each other. Plagiarism will be dealt with
according to the course policy.
• Submission after due time will not be accepted.

Follow this naming convention for your report, it should highlight difficulties you faced and things you
learned in this assignment. Naming Pattern ( Roll#_Assignment#.pdf e.g BSCE23000_Assignment3.pdf )
In this assignment you have to do following tasks:
Task 1: Ensure that you have installed all three softwares in your personal computer (Github,
Cygwin & CLion). Now, accept the assignment posted in Google Classroom and after accepting,
clone the repository to your computer. Make sure you have logged into the github app with your
account.
Task 2: Open Cygwin app, Move to your code directory with following command “cd
<path_of_folder>”
<path_of_folder> can be automatically populated by dragging the folder and dropping it to the
cygwin window.
Run the code through Cygwin, use command “make run”, to get the output of the code
Task 3: Solve the given problems, write code using CLion or any other IDE.
Task 4: Keep your code in the respective git cloned folder.
Task 5: Commit and Push the changes through the Github App
Task 5: Write the code in separate files (structure_name.h, structure_name.cpp) for each struct, declare
struct variables, and call functions from main.cpp. Ensure that file names are in lowercase.
Task 6: Run ‘make run’ to run C++ code
Task 7: Run ‘make test’ to test the C++ code

Object Oriented Programming


CE101T-Spring 2024
Problem Statement: Student Records Management
Define a Student structure with the following attributes:

name: A string representing the student's name.


rollNumber: A string representing the student's roll number.
department: A string representing the student's department.
gpas: An array of 8 floats representing the student's GPAs in 8 different courses.

Assignment 2

Part 1: Constructors
Part 2: Member Function to Extract First Name & Last Name
Part 3: Member Function to Convert Department Name
Part 4: Member Function to Extract Numerical Part of Roll
Number
Part 5: Non-Member Function to Calculate CGPA

Lab 3

Use global variables such as MAX_STUDENTS (int), students[MAX_STUDENTS]


(Student), numStudents (int)

Part 6: Add New Student


Part 7: Delete a Student by Roll Number
Part 8: Display Students

Note: Extend the previous assignment 2 by incorporating lab 3 to complete assignment 3.

Object Oriented Programming


CE101T-Spring 2024
Assignment 3

Part 9: Function to find student by Roll Number


Implement a non member function findStudentByRollNumber that finds and returns the
corresponding student object.
Student findStudentByRollNumber(const string &roll_number);

Part 10: Function to find student with Highest GPA


Implement a non member function findStudentWithHighestCGPA that finds and returns the
corresponding student object.
Student findStudentWithHighestCGPA();

Part 11: Function to Update student info


Implement a non member function updateStudentInfo that updates the corresponding student
object.
void updateStudentInfo(Student& student, const string& newName, const string&
newDepartment, float* newGPAs);

Part 12: Function to Sort students by Roll Number


Implement a non member function sortStudentsByRollNumber that sort the student objects in
student array by roll number.
void sortStudentsByRollNumber();

Part 13: Function to Display detailed info of students


Implement a non member function displayDetailedInfo that display all student objects in the
format as below:
Sample Output:
Name: Ali Hamza
Roll Number: bsce23001
Department: Computer Engineering
GPAs: 3.5 3.2 3.7 3.8 4.0 3.9 3.6 3.4
CGPA: 3.7 (3.6625 round off to 1 digit after point)

void displayDetailedInfo();

Object Oriented Programming


CE101T-Spring 2024

You might also like