Sei sulla pagina 1di 30

SUPERIOR UNIVERSITY LAHORE

Faculty of Computer Science & IT


Semester Project

SUBMITTED TO
MR.NADEEM JABBRAN
SUBJECT OOP
MR.NADEEM JABBAR

University Examination System

Object Oriented Programming


Project Team
Student Name Student Roll Number Program

SABA MATLOOB AHMAD 08 MASTER IN


INFORMATION
TECHNOLOGY
DEDICATION

Dedicated
I dedicated this Project to my Parents who have been great source of inspiration and support.

This Project is also dedicated to Mr.Nadeem Jabbar who encourages us to build our motivation.
ACKNOWLEDGEMENT

ALLHUMDULILLAH, no doubt all praises to ALLAH Almighty, the most Merciful and most
Beneficent, for the successful completion of this project. who gaves us the quality,learning and
bravery to finish this errand. After a challenging period, I feel humbled to achieve a successful
completion of my project which absolutely would have not been possible without the enormous
provision and leadership from Mr.Nadeem Jabbar . He has been a role model for me, by perfectly
showing focus, discipline and strive for perfection in his work. I am very honoured to have the
opportunity to work with him. We might to pay huge amounts of thanks and offer my regards to
our Supe-rvisor Mr. Nadeem Jabbra for his valueable direction,advise and support all through
the learning pro-cedure that he gaves me a helpful course to finish our venture. Finally, I am
especially thankful to my family for unlimited care and support me in harsh time.
Contents
Dedication vii
1. Introduction………..………………………………………..........1
1.1 What is Cloud Computing?.....................................................2
1.2 Organization of Project………………………………………9
2. Proposed Scheme………...……………………………………...22
3. 3.1 Introduction………………………………………………......23

4. Experimental Evaluation……………….………………………30
4.1 Implementation and Evaluation………………………………31
Chapter 1
INTRODUCTION

University Examination System project is developed in object oriented programming using C++
language. In University, a large amount of data is processed and the results are used in running
an organization. The University Examination system maintains the list of colleges and their
different streams along with the result department. There are menus and sub menus in the
output of the project which has given this project an organized look.

To maintain the record of colleges, students, examination and result, the university department
prepares the record for each department, showing the total number of students. It also keeps
track of any modification necessary related to students and colleges, and produces regular
reports for the organization giving the total information required. This whole system is based on
a concept to generate student’s report in grading system.

After filling all these, student’s grade report is displayed with CGPA and Status. This system can
be used mostly in schools and colleges for systematic grading reports and it is not time
consuming. This whole project is designed in ‘C++’ language & different variables and strings have
been used for the development. It is easy to operate and understand by the users. Additionally,
the project also maintains and handles the examination as well as the result department with a
proper menu system. In this post, I have made this project available for free download with full
project result report, documentation, output screens and source code.
Chapter 2
Proposed Approach
Object Oriented Programming

The major motivating factor in the invention of object-oriented approach is to remove some of
the flaws encountered in the procedural approach. OOP treats data as a critical element in the
program development and does not allow it to flow freely around the system. It ties data more
closely to the functions that operate on it and protects it from accidental modification from
outside functions. Object – oriented programming is the most recent concept among
programming paradigms. We define “object-oriented programming as an approach that provides
a way of modularize problems by creating partitioned memory area for both data and functions
that can be used as templates for creating copies of such modules on demand.

Charcteristcs Of OOP Languages

Object: Objects are entities, which can exist individually. It has its own properties
and methods, where properties define the outlook of the object and methods define
their procedures.

Class: It is a template used to define different objects of same type.

Encapsulation: The data and the methods, which operate on the data, are
combined and placed in a group, this phenomenon is known as encapsulation, and
the group is known as the object.

Abstraction: It means hiding of the data of one object of a class from another object
of the same class.
Inheritance: Inheritance is the property by which an existing class can be used to
create new classes, by deriving all the properties and methods of the old class to
the new class and also adding new properties /methods in the new class. The old
class is known as a base class or super class. The new class is known as derived class
or sub class.

Polymorphism: Polymorphism means “One interface and multiple methods” i.e.


one interface can be used to provide different functionalities.
There are two kinds of polymorphism:

a) Compile time polymorphism: It is also known as early binding, as the


interfaces are bind with their methods at compile time. It is accomplished
using function overloading and operator overloading.
b) Run time polymorphism: It is also known as late binding. In run time
polymorphism the interface and its method bind at the time of execution. It
is accomplished using virtual function.

Multiple Inheritance: When two or more classes are used to define a single class,
then it is known as multiple inheritance.

3.1 Introduction

Write here your approach which you have implemented.

Class

Loop
While

Do while

If

Else If

Switch

Tool you used:

Screenshot of your output

Tools/Platforms and Languages Used

Hardware Configuration

Processor: 845 Intel Processor

Main Memory: 128 MB RAM

HDD: 20 GB

FDD: 1.44 MB

SVGA Color monitor


Logitech mouse
105 keys keyboard

Software
Operating System: WINDOWS 98 SE

Programming Language: C++

Documentation: MS-WORD 2000


Backup media: Hard Disk Backup

CODING OF THE PROJECT

//***************************************************************

// HEADER FILE USED IN PROJECT

//****************************************************************

#include<iostream>

#include<fstream>

#include<iomanip>

using namespace std;

//***************************************************************

// CLASS USED IN PROJECT

//****************************************************************

class student

int rollno;

char name[50];
int OOP_marks, DB_marks, WEBDEVELOP_marks, DCN_marks, SE_marks;

double per;

char grade;

void calculate(); //function to calculate grade

public:

void getdata(); //function to accept data from user

void showdata() const; //function to show data on screen

void show_tabular() const;

int retrollno() const;

}; //class ends here

void student::calculate()

per=(OOP_marks+DB_marks+
WEBDEVELOP_marks+DCN_marks+SE_marks)/5.0;

if(per>=80)

grade='A';

else if(per>=65)

grade='B';

else if(per>=50)

grade='C';

else
grade='F';

void student::getdata()

cout<<"\nEnter The Roll Number Of Student ";

cin>>rollno;

cout<<"\n\nEnter The Name of Student ";

cin.ignore();

cin.getline(name,50);

cout<<"\nEnter The Marks In OOP Out Of 100 : ";

cin>>OOP_marks;

cout<<"\nEnter The marks In DB Out Of 100 : ";

cin>>DB_marks;

cout<<"\nEnter The Marks In WEBDEVELOP Out Of 100 : ";

cin>>WEBDEVELOP_marks;

cout<<"\nEnter The Marks In DCN Out Of 100 : ";

cin>>DCN_marks;

cout<<"\nEnter The Marks In SE Out Of 100 : ";

cin>>SE_marks;

calculate();

}
void student::showdata() const

cout<<"\nRoll Number Of Student : "<<rollno;

cout<<"\nName Of Student : "<<name;

cout<<"\nMarks In OOP : "<<OOP_marks;

cout<<"\nMarks In DB : "<<DB_marks;

cout<<"\nMarks In WEBDEVELOP : "<<WEBDEVELOP_marks;

cout<<"\nMarks In DCN : "<<DCN_marks;

cout<<"\nMarks In SE :"<<SE_marks;

cout<<"\nPercentage Of Student Is :"<<per;

cout<<"\nGrade Of Student Is :"<<grade;

void student::show_tabular() const

cout<<rollno<<setw(6)<<"
"<<name<<setw(10)<<OOP_marks<<setw(4)<<DB_marks<<setw(4)<<WEBDEVEL
OP_marks<<setw(4)

<<DCN_marks<<setw(4)<<SE_marks<<setw(8)<<per<<setw(6)<<grade<<en
dl;

int student::retrollno() const


{

return rollno;

//***************************************************************

// function declaration

//****************************************************************

void write_student(); //write the record in binary file

void display_all(); //read all records from binary file

void display_sp(int); //accept rollno and read record from binary file

void modify_student(int);//accept rollno and update record of binary file

void delete_student(int); //accept rollno and delete selected records from binary
file

void class_result(); //display all records in tabular format from binary file

void result(); //display result menu

void intro(); //display welcome screen

void entry_menu(); //display entry menu on screen

//***************************************************************

// THE MAIN FUNCTION OF PROGRAM


//****************************************************************

int main()

char ch;

cout.setf(ios::fixed|ios::showpoint);

cout<<setprecision(2); // program outputs decimal number to two decimal


places

intro();

do

system("cls");

cout<<"\n\n\n\tMAIN MENU";

cout<<"\n\n\t01. RESULT MENU";

cout<<"\n\n\t02. ENTRY/EDIT MENU";

cout<<"\n\n\t03. EXIT";

cout<<"\n\n\tPlease Select Your Option (1-3) ";

cin>>ch;

switch(ch)

case '1': result();

break;
case '2': entry_menu();

break;

case '3':

break;

default :cout<<"\a";

}while(ch!='3');

return 0;

//***************************************************************

// function to write in file

//****************************************************************

void write_student()

student st;

ofstream outFile;

outFile.open("student.dat",ios::binary|ios::app);

st.getdata();

outFile.write(reinterpret_cast<char *> (&st), sizeof(student));

outFile.close();

cout<<"\n\nStudent record Has Been Created ";


cin.ignore();

cin.get();

//***************************************************************

// function to read all records from file

//****************************************************************

void display_all()

student st;

ifstream inFile;

inFile.open("student.dat",ios::binary);

if(!inFile)

cout<<"File could not be open !! Press any Key...";

cin.ignore();

cin.get();

return;

cout<<"\n\n\n\t\tDISPLAY ALL RECORD !!!\n\n";

while(inFile.read(reinterpret_cast<char *> (&st), sizeof(student)))

{
st.showdata();

cout<<"\n\n====================================\n";

inFile.close();

cin.ignore();

cin.get();

//***************************************************************

// function to read specific record from file

//****************************************************************

void display_sp(int n)

student st;

ifstream inFile;

inFile.open("student.dat",ios::binary);

if(!inFile)

cout<<"File could not be open !! Press any Key...";

cin.ignore();

cin.get();

return;
}

bool flag=false;

while(inFile.read(reinterpret_cast<char *> (&st), sizeof(student)))

if(st.retrollno()==n)

st.showdata();

flag=true;

inFile.close();

if(flag==false)

cout<<"\n\nrecord not exist";

cin.ignore();

cin.get();

//***************************************************************

// function to modify record of file

//****************************************************************

void modify_student(int n)

{
bool found=false;

student st;

fstream File;

File.open("student.dat",ios::binary|ios::in|ios::out);

if(!File)

cout<<"File could not be open !! Press any Key...";

cin.ignore();

cin.get();

return;

while(!File.eof() && found==false)

File.read(reinterpret_cast<char *> (&st), sizeof(student));

if(st.retrollno()==n)

st.showdata();

cout<<"\n\nPlease Enter The New Details Of Student"<<endl;

st.getdata();

int pos=(-1)*static_cast<int>(sizeof(st));

File.seekp(pos,ios::cur);

File.write(reinterpret_cast<char *> (&st), sizeof(student));


cout<<"\n\n\t Record Updated";

found=true;

File.close();

if(found==false)

cout<<"\n\n Record Not Found ";

cin.ignore();

cin.get();

//***************************************************************

// function to delete record of file

//****************************************************************

void delete_student(int n)

student st;

ifstream inFile;

inFile.open("student.dat",ios::binary);

if(!inFile)

cout<<"File could not be open !! Press any Key...";


cin.ignore();

cin.get();

return;

ofstream outFile;

outFile.open("Temp.dat",ios::out);

inFile.seekg(0,ios::beg);

while(inFile.read(reinterpret_cast<char *> (&st), sizeof(student)))

if(st.retrollno()!=n)

outFile.write(reinterpret_cast<char *> (&st), sizeof(student));

outFile.close();

inFile.close();

remove("student.dat");

rename("Temp.dat","student.dat");

cout<<"\n\n\tRecord Deleted ..";

cin.ignore();

cin.get();

}
//***************************************************************

// function to display all students grade report

//****************************************************************

void class_result()

student st;

ifstream inFile;

inFile.open("student.dat",ios::binary);

if(!inFile)

cout<<"File could not be open !! Press any Key...";

cin.ignore();

cin.get();

return;

cout<<"\n\n\t\tALL STUDENTS RESULT \n\n";

cout<<"=======================================================
==================================\n";

cout<<"R.No Name OOP DB WEBDEVELOP DCN SE %age


Grade"<<endl;

cout<<"=======================================================
=====================================\n";
while(inFile.read(reinterpret_cast<char *> (&st), sizeof(student)))

st.show_tabular();

cin.ignore();

cin.get();

inFile.close();

//***************************************************************

// function to display result menu

//****************************************************************

void result()

char ch;

int rno;

system("cls");

cout<<"\n\n\n\tRESULT MENU";

cout<<"\n\n\n\t1. Class Result";

cout<<"\n\n\t2. Student Result Card";

cout<<"\n\n\t3. Back to Main Menu";

cout<<"\n\n\n\tEnter Choice (1/2/3)? ";


cin>>ch;

system("cls");

switch(ch)

case '1' : class_result(); break;

case '2' : cout<<"\n\n\tEnter Roll Number Of Student : "; cin>>rno;

display_sp(rno); break;

case '3' : break;

default: cout<<"\a";

//***************************************************************

// INTRODUCTION FUNCTION

//****************************************************************

void intro()

cout<<"\n\n\n\t\t STUDENT";

cout<<"\n\n\t\tRESULT CARD";

cout<<"\n\n\t\t UNIVERSITY EXAMINATION SYSTEM";

cout<<"\n\n\n\tMADE BY : SABA MATLOOB";

cout<<"\n\tUNIVERSITY : SUPERIOR UNIVERSITY";


cin.get();

//***************************************************************

// ENTRY / EDIT MENU FUNCTION

//****************************************************************

void entry_menu()

char ch;

int num;

system("cls");

cout<<"\n\n\n\tENTRY MENU";

cout<<"\n\n\t1.CREATE STUDENT RECORD";

cout<<"\n\n\t2.DISPLAY ALL STUDENTS RECORDS";

cout<<"\n\n\t3.SEARCH STUDENT RECORD ";

cout<<"\n\n\t4.MODIFY STUDENT RECORD";

cout<<"\n\n\t5.DELETE STUDENT RECORD";

cout<<"\n\n\t6.BACK TO MAIN MENU";

cout<<"\n\n\tPlease Enter Your Choice (1-6) ";

cin>>ch;

system("cls");

switch(ch)
{

case '1': write_student(); break;

case '2': display_all(); break;

case '3': cout<<"\n\n\tPlease Enter The roll number "; cin>>num;

display_sp(num); break;

case '4': cout<<"\n\n\tPlease Enter The roll number "; cin>>num;

modify_student(num);break;

case '5': cout<<"\n\n\tPlease Enter The roll number "; cin>>num;

delete_student(num);break;

case '6': break;

default: cout<<"\a"; entry_menu();

//***************************************************************

// END OF PROJECT

//***************************************************************
SCREEN SHOOT OF PROJECT

MAIN MENU
ENTRY MENU
DISPLAY DATA

Potrebbero piacerti anche