0% found this document useful (0 votes)
5 views17 pages

24L 6021 (OEL Report)

The document is a design project report by Hassan Shahzad for an object-oriented programming project that reads student data from files and grades them based on specific criteria. It outlines the problem analysis, design requirements, feasibility analysis, and includes a class hierarchy with a parent 'Student' class and child classes for different subjects. The report concludes that while the code is functional and meets the project's objectives, there are areas for improvement, such as exception handling and more efficient file processing.

Uploaded by

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

24L 6021 (OEL Report)

The document is a design project report by Hassan Shahzad for an object-oriented programming project that reads student data from files and grades them based on specific criteria. It outlines the problem analysis, design requirements, feasibility analysis, and includes a class hierarchy with a parent 'Student' class and child classes for different subjects. The report concludes that while the code is functional and meets the project's objectives, there are areas for improvement, such as exception handling and more efficient file processing.

Uploaded by

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

[Programming Fundamentals]

[Design Project/Experiment Report]

[Open Ended Lab]

Submitted by:

[Hassan Shahzad] [24L-


6021]

Submitted to:
[Miss Aliha Tanveer]

[15/04/2025]

Department of Electrical Engineering


National University of Computer and Emerging Sciences, Lahore
Table of Contents

1 Introduction
2 Problem Analysis
3 Design Requirements
4 Feasibility Analysis
5 Possible Solutions
6 Preliminary Design
7 Design Description
8 Software Simulation
9 Experimental Results
10 Performance Analysis
11 Future Scope
12 Social and Cultural Implications
13 Conclusio
n References
Introduction

[The main idea of the project is to design a program for reading student

data from files and to produce an output containing their information along
with their marks for the subject based on a given criteria and grade them
respectively. For this, I am using an object oriented programming based
approach by using techniques like classes, polymorphism and inheritance.
]
Problem Analysis

[The problem given is that we have to take data from a file that contains a

students first name, last name and details regarding their course. Now, I am
assuming that data for students such as Math students and History Students is
stored in separate files so I am writing a program to open files specific to
different subjects and reading them and using the data in those files to produce
a similar file which copies the data in another file which is known as the output
file.

Using the concepts of classes, inheritance and polymorphism, I first made a


parent class by the name of “Student” and made child classes for the given
subjects(Math,History and English) which inherited from Student class. The
student class contains two functions, one for reading data and one for writing
data to a file and made them pure virtual functions since they would have to
input different values for subjects for example for english students it requires
attendance whereas for math students it requires 3 quiz marks and etc.
]
Design Requirements

[The first constraint was the mandatory file separation which was used to

separate the class definition, methods and the main program which wasn’t that
much of a problem as I just made different header and cpp files.
The second constraint was designing a class hierarchy, the one I chose was a
single parent and three child classes. As I explained previously, the base class
contains the pure virtual functions for reading data and writing data to a file, the
reason for making it pure virtual was again as mentioned before, the function
behaves differently for all the subjects differently for example the English class
requires attendance of students to be taken into account in order to calculate
grades whereas the Math class does not require this.
The third constraint was implementing file I/O which wasn’t much of a problem
as well as the code was pretty simple and straightforward, for the readdata
function we simply opened the required file and set a while loop till the end of
the file, copied the required data items and then output them into the desired
file.
The fourth constraint was of a grading system, I designed a normal grading
system with the displaydata class which would calculate the grade based on the
total marks obtained out of 100.
]
Feasibility Analysis

[In my opinion, this project is feasible to some extent as it took me roughly 4-5

working days with about an average of 3 hrs per day to come up with the
prototype. In, my opinion this object with respect to its useability, cost and
time taken to code does prove to be feasible and the client’s goal can be met.
]
Possible Solutions

[I choose the solution I have come up with as it displays good use of polymorphism within
the code as well the use of inheritance to access functions which would reduce data
redundancy and less code would be required.

Comparing my code to a code in which the programmer made separate classes


and used separate functions without inheritance and polymorphism. Not only
is this time consuming but also not cost effective as well as efficient in any
way.

The programmer has to write twice the amount of code I had to write but also
had to write different codes for reading and writing data to files as they didn’t
use polymorphism.

All of these cons are fixed within my code as it satisfies the feasibility criteria
and also requires less lines of code making it more time efficient.
]
Preliminary Design

[I made use of the Base class of student and made three derived classes for different courses.

Parent class:

Child Classes:

]
Design Description

[The first block is the student class which I have made as a pure virtual class as it
contains two functions which have different parameters when used by the child
classes. I have also included a grading system within the class as a protected
member so it cannot be utilized anywhere out of the classes.
The second block is the child classes which have different data items and thus
need different read and write functions, the assumption I have taken is that data
for different courses is kept different. For example, data for Math students is
kept in a math file and contains only information of those students who have
math as their subject. A few other assumptions include the first name being in
the beginning , then the last name and so on.

The third block you can say is writing the main program to create objects of the
child classes and then calling the read and write functions of those classes.

At the end we are left with three output files for the students with different
subjects, for example one file for math students and one for history students.
]
Software Simulation (Optional)

Before running (Math File):

After running (Math File):


Experimental Results

[ Input Files:
1) English

2)Math

3)History

Output Files:
1)Math

2)English

3)History

]
Performance Analysis

[After analysis of the result, I came to the conclusion that the output of the
program meets the criterias set and the code works efficiently.
The code does as intended in the task, it takes data values from the file and
produces a report/output file that neatly displays the data of the students as well
as the grade they have scored.
As seen from the above posted screenshots it can be verified that the program
does indeed perform the given tasks.
]
Future Scope (Optional)

[Some possible improvements I had for my design is to add exception handling for
files so that any wrong file encountered may be dealt with in the form of an error
message.
Another tweak I would make is to write such a code which would read data from a
single file which would contain several values of a subject in a single file, for
example reading a file which has subjects of math, english and history collectively.
The code would then check which data belongs to which type and then write the
data to the matching file. ]
Social and Cultural Implications (Optional)
Conclusion

[To conclude, while the written code may not be flawless, it represents a sincere
and structured attempt to meet the outlined objectives of the project. It
successfully fulfills the core requirements, such as implementing a class hierarchy
with virtual functions, handling course-specific grading schemes, and managing
data through file input and output. The code has gone through several revisions,
each bringing it closer to a more refined and functional state. Although there is still
room for improvement, particularly in areas like exception handling, input
validation, and more efficient file processing, the current version performs well
within the given constraints.
]
References

You might also like