Faculty Managment Project in C++ (Documentation +codeing)
Faculty Managment Project in C++ (Documentation +codeing)
Faculty Managment Project in C++ (Documentation +codeing)
: Further Programming Concept : CE00314-2 & FPC[C++] : Ryan Prasad : pt0881151 [Software] : 11/11/2010
CERTIFICATE
This is to certify that Mr. Ryan Prasad (pt0881151), have submitted the FURTHER PROGRAMING CONCEPT Project. He has successfully completed the project in the assigned duration, under the guidance of Ryan Prasad, Project Co-coordinator.
Acknowledgement Introduction of Project Design of implemented code OOPS concept implementation Validation codes applied into implementation code Reference:
ACKNOWLEDGEMENT
Firstly I would like to give thanks to APIIT INDIA for giving us the opportunity to do such a project. Then I would like to give thanks to my lecturer Aditi mittal for teaching us FPC module. Then I would like to thank to our director sir for providing me a great platform. Without those helps it cant be come to completion. We are making Software in FPC on an organization. It is a project where different persons have different access priority like administrator can add, delete, update, and view and search all the peoples records. Increased competition from existing and emerging competitors this software will constantly consider better ways to meet the needs of the organization .This is a very interactive project & user friendly project.
Introduction
The module further programming in C++ completely allows us to deal with several practical programming approaches of problem solving. With its object oriented handling and structure C++ proves to be the best programming language for many applications. The project is to development on faculty management system using C++ code with object oriented concept and to introduce current technical issues in the field of object oriented programming (OOP). The basic objectives were:There are two modules administrator and user. The application will be used by the administrator to enter,search,edit and view the product information. The interface should be attractive, very user friendly. Delete the record of faculty,calculate the salary of faculty.
The main objective that is needed to be kept in mind is that our program meets all system requirements.
PROJECT DESCRIPTION FUNCTIONALITY It is a very simple and easy to use program created as per the given conditions of the faculty management system. This application will be used by the administrator to enter, search, edit and view the faculty information and information can be generated for the faculty according to annual salary. The administrator is allowed to: Register faculty as users of the system Add, search and edit personal information of faculty Delete record of any faculty Asia Pacific Institute Of Information Technology and Staffordshire 5 University,London
The following details of each staff are recorded: Identification Card (IC) Number Name Gender Qualification Designation Department Date Joined Nationality Date Of Birth Marital Status NOTE: Each staff has a unique Identification Card (IC) Number and this will be automatically generated by the system has a unique id number. The search of any faculty in the system can be done by using the following categories: Identification Card (IC) Number Designation Department
HARDWARE AND SOFTWARE SPECIFICATIONS For the proper running the program, the user should need the following hardware and software requirements. Hardware LCD/CRT Monitor o A LCD or a CRT monitor is greatest necessary for the functioning of the program. A screen that shall display all the information regarding the final result is very necessary. The user will be able to use the program and the administrator can maintain every detail only if provided with a screen, i.e. a LCD or CRT monitor. Asia Pacific Institute Of Information Technology and Staffordshire 6 University,London
Justification: As I already told about access priority of the different persons of the organization generally admin of the any organization have more powerful persons so I have given top position to the admin. I have given second access priority to the faculty because it has more powerful than a staff. When we consider about staff then generally they are third grade persons so they have lowest access priority.
Description and justification of the implementation codes in terms of object oriented programming concepts What is object? Before discussing about object oriented programming it is important to know something about objects. An object can be defined as a real world entity that can perform a set of activities which determines its behavior. An object requests another object to
public:
void get_number(char *s,char *ad_pass) { Asia Pacific Institute Of Information Technology and Staffordshire 9 University,London
admin_password=new char[length+1]; strcpy(admin_password,ad_pass); Object: Object is defined as an instance of a class which has its own state and behavior. The set of values of the attributes of an object is called its state.
Inheritance: Inheritance is a process in which one class inherits the property of another class. The class which inherits the property of another class is called the derived class whereas the class being inherited is called as the base class. The derived class has all the features of the base class and can also add its own features. The main advantages of using inheritance are: Reusability: Once a code written in base class need not to be written again and again in the derived class. Saves time: By the concept of reusability, as there is no need to write the code again and again therefore it saves time. Greater reliability: As inheritance increases program structure thus it results in greater reliability.
Types of inheritance:
protected: char name[32]; char gender[34]; char nationality[35]; int date_of_join; int month ; int year; int day; char martial_status[21]; char password2[23]; char re_type[23];
Abstraction: Abstraction is the property of representing the essential features and hiding the background details. There are mainly 2 kinds of abstraction, functional abstraction and data abstraction. The main difference between the 2 is that functional abstraction refers to a function that can be used without taking into account how the function is implemented whereas data abstraction refers to the data that can be used without taking into account how the data is stored. Advantages of abstraction: Flexibility in approach Enhanced security Asia Pacific Institute Of Information Technology and Staffordshire 11 University,London
Polymorphism: It is a feature of OOP which allows 2 or more methods to have the same name within a class. Whenever that particular method is called the decision is taken by considering the following: Number of parameters passed to the method. Type of parameters passed to the method. Order of parameters passed to the method. Polymorphism is of 2 types: Run-time polymorphism. Compile-time polymorphism. class admin2 :public faculty1,public faculty2 { public: void get_authentic(void); void search_by_id(fstream &); void search_by_desigination(fstream &); void serach_by_department(fstream &); void delete_by_id(fstream &); void edit(fstream &); void get_authentic1();
uml diagram
Class admin 1
Data member +get number; +void help; +qualification +department +double salary +date of birth +date of join + void date +void login +search id +search deap +void put date +if stream +exit
Validation is generally used while entering the data in context of this program validation is required at many places like name of the faculty . Staff Number: staff number which cannot be character or specials character it should be numeric only Name: Name cannot be alphanumeric or any special character also it cannot be a number so I have given proper validation for that. Identification Card (IC) Number: In IC card number it will accept both numeric as well as string value. Gender: As in this I have given validation, so it will accept only the specific string value such as either M/F. Designation: In this it will accept only string value. Department: As in department also it will only accept the string value. Date Joined: Date of joining should always be after date of birth and it will be numeric only .As well as date of joining always be before the system date. Nationality: It will accept the only string value. And it should not accept the special character.
specific string value such as either married or unmarried. Password: The length of the password should not be less than six digits.
Function:- This has been used to make the code more relevant and more fabricated and make it more reliable.this has been used to make the code more user friendly.
Classs:- class has been ised to make the coding more real associated with the real world, Abstration:- By useing the concept of class we can implement the concept of data abstraction .means hiding the data from out side world.
Polymorphism:-The same value is sand to the more the one object of the class.
Inheritance:- the same property can be implemented to the child class from parent class.
Filehandaling:- the file handling has been use to save the data for the further use.
Reference
E Balagurusamy, A.E. 1994, Object oriented Programming with C++ Third Edition, McGraw-Hill, London. H.M. Deitel , C++ How to Program, Fifth Edition, Prentice-hall of India, New Delhi K R Venugopal, Rajkumar, Ravishankar 2001, Mastering C++, Tata McGraw Hill Publishing Company Limited, New Delhi.
Und. 2001, C++ Handbook, SSI Press (SSI Limited), Chennai
3.0
OBJECTIVES OF THIS COURSEWORK Develop the practical ability to describe, justify and implement an object oriented system. Introduce current technical issues in the field of object oriented programming (OOP).
4.0
LEARNING OUTCOMES At the end of this coursework, you should be able to: Explain object oriented programming concepts and apply them to the modelling of real world systems. Explain the object oriented paradigm and utilisation of the offered facilities. Demonstrate the ability to develop and derive new class structures and organise them such that they will model real world systems within computers.
5.0
TYPE Individual Assignment Asia Pacific Institute Of Information Technology and Staffordshire 19 University,London
The following details of each staff are recorded: Identification Card (IC) Number Name Gender Qualification Designation Department (Business/Information Development/Multimedia) Date Joined Nationality Date Of Birth Marital Status Networking Technology/Application
Each staff has a unique Identification Card (IC) Number and this will be automatically generated by the system. Classification of designation for faculty is categorised as follows: Asia Pacific Institute Of Information Technology and Staffordshire 20 University,London
The category of designation and the related departments are determined by you in the system. Calculation of Salary will be done on the following basis: Designation Director Doctorate Professor Associate Professor Assistant Professor Sr. Lecturer Lecturer Basic Salary Rs. 30,000 Rs. 28,000 Rs. 26,000 Rs. 24,000 Rs. 22,000 Rs. 15,000 Rs. 10,000 DA 30% of BS 27% of BS 25% of BS 25% of BS 20% of BS 18% of BS 12% of BS HRA 10% of BS 10% of BS 10% of BS 5% of BS 5% of BS 5% of BS 5% of BS
A faculty can view only his/her salary package. The searching of any record in the system must be done by using the following categories: IC Number Designation Department
If a list of record is displayed after the search, the system should allow fine searching in order to allow only one record to be displayed as the final selection. You should design the system so that the user is able to edit the selective category in the search record. After the edit process is done, the user is prompted for saving purpose. Asia Pacific Institute Of Information Technology and Staffordshire 21 University,London
Coding
//using header file #include<iostream> #include<stdio.h> #include<conio.h> #include <fstream.h> #include<iomanip.h> #include<stdlib.h> #include <ctype.h> #include <string> #include<string.h> #include <Windows.h> #include<process.h> void gotoxy(int x, int y) //used for fixing the cordinates { COORD coord; coord.X = x; coord.Y = y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE) , coord); } class admin1 {
virtual void Help()//acheiving the concept of polymorphism { cout<<"\n\t========================================== ======================"; cout<<"\t\t------------Welcome to Help System-----------|\n"; cout<<"\t=========================================== =====================\n\n\n"; cout<<"\t\t==>ENTER 1 TO FORGET USERNAME \n\n\n"; cout<<"\t\t==>ENTER 2 TO FORGET PASSWORD \n\n\n"; cout<<"\t\t==>ENTER 3 TO MAIN MENU \n\n\n";
:";
cin.getline(name,30); int i; int flag=1; for(i=0;i<strlen(name);i++)// used for validation of name { if((!isalpha(name[i]))&&(!isspace(name[i]))) flag=2; } if(flag==2) { printf("\nInvalid Name names accept only characters"); flag=1; goto k; }
:";
char dir[]="director"; char lec[]="lecture"; char group[]="groupleader"; char doc[]="doctorate"; char pro[]="professor"; char asspro[]="assistantprofessor"; char associatepro[]="associateprofessor"; char srlecture[]="srlecturer";
cout<<"\n\t========================================== ======================="; cout<<"\n\t========================================== ======================="; cout<<"\n\t|| Enter 1 B.TECH OR MCA OR BOTH ||\n"; cout<<"\t|| Enter 2 B.TECH OR MCA OR BOTH PLUS EXPERINENCE(NECESSARY) ||\n"; cout<<"\t|| Enter 3 M.B.A OR MS OR MPHIL ||\n"; cout<<"\t|| Enter 4.M.B.A OR MS OR MPHIL PLUS EXPERINECE(NECESSARY) ||\n"; cout<<"\t|| Enter 5 P.H.D ||\n"; cout<<"\t|| Enter 6 P.H.D PLUS EXPERINENCE(EXPERINCE NECCESARY) ||\n"; cout<<"\t|| Enter 7.P.H.D PLUS MORE THEN TWO YEAR EXPERINECE ||"; cout<<"\n\t===============ENTER YOUR CHOICE HERE================================"; cout<<"\n\t==============your choice is=>"; int choice4; cin>>choice4; switch(choice4) { case 1: { cout<<"Congratulation"<<endl; cout<<" Your Desigination is "<<endl; strcpy(desinigation,lec); cout<<desinigation;
Asia Pacific Institute Of Information Technology and Staffordshire 30 University,London
} case 7: { cout<<"Congratulation"<<endl; cout<<" Your Desigination is "<<endl; strcpy(desinigation,dir); cout<<desinigation; salary= (30000 + 0.30*30000+ 0.10*30000)*12 ; cout<<" Your Anuual Package is "; cout<<setw(50); cout<<salary; break;
cin.ignore(INT_MAX, '\n'); char business[]="business"; char information_Networking_technology[]="information_Networking_technolo gy"; char application_development[]="application_development"; char multimedia[]="multimedia";
cout<<"\n\t============================================== =================="; cout<<"\t\t| SELECT YOUR DEPARTMENT HERE |\n"; cout<<"\t=========================================== ===================\n\n\n"; cout<<"\n\t========================================== ======================="; cout<<"\n\t========================================== ======================="; cout<<"\t\t|| Enter 1 BUSINESS ||\n";
Asia Pacific Institute Of Information Technology and Staffordshire 33 University,London
case 2: { strcpy(department,information_Networking_technology); cout<<"It is a group leader if yes then press 1 ortherwise 2"; int count; cin>>count; if(count==1 && count1==0) { count1++; cout<<"Congrtaulation u get the post of Group leader";cout<<endl; cout<<"Now your salary is "; salary= (50000 + 0.30*30000+ 0.10*30000)*12 ; cout<<" Your Anuual Package is "; cout<<setw(50); cout<<salary; break; } else { cout<<"sorry group leader is already there"; break; }
break; } case 3: { strcpy(department,application_development); cout<<"It is a group leader if yes then press 1 ortherwise 2"; int count; cin>>count; if(count==1 && count1==0) {
Asia Pacific Institute Of Information Technology and Staffordshire 35 University,London
/*char married[]="married"; char unmarried[]="unmarried"; cout<<"Entre the MARTIAL STATUS "<<endl; q: cout<<"\t\t==>ENTER 1 TO MARRIED \n\n\n"; cout<<"\t\t==>ENTER 2 TO UNMARRIED \n\n\n"; int cgh1; switch(cgh1) { case 1: { strcpy(martial_status,married); break; } case 2: { strcpy(martial_status,unmarried); break; } default: { cout<<"Please Entre a Value 1 or 2 "; goto q; break;
Asia Pacific Institute Of Information Technology and Staffordshire 37 University,London
} void put_data()//used for putting the data in console { void gotoxy(); SYSTEMTIME st; GetSystemTime(&st); cout<<"ID :";cout<<id;cout<<endl;
cout<<"DATE OF JOINING"; cout<<"DAYS ";cout<<st.wDay;cout<<endl; cout<<"MONTHS ";cout<<st.wMonth;cout<<endl; cout<<"YEAR ";cout<<st.wYear;cout<<endl; cout<<"NAME :";cout<<name;cout<<endl; cout<<"GENDER :";cout<<gender;cout<<endl; // cout<<"QUALIFICATION :";cout<<qualification; cout<<"DESIGINATION :";cout<<desinigation;cout<<endl; cout<<"DEPARTMNET :";cout<<department;cout<<endl; cout<<"NATIOALITY :";cout<<nationality;cout<<endl; cout<<"MARTIAL STATUTS :";cout<<martial_status; cout<<endl ; cout<<"SALARY :";cout<<salary; cout<<endl ;
}; class admin2 :public faculty1,public faculty2 { public: void get_authentic(void); void search_by_id(fstream &); void search_by_desigination(fstream &); void serach_by_department(fstream &); void delete_by_id(fstream &); void edit(fstream &); void get_authentic1(); void Help() { cout<<"\n\t========================================== ======================";
Asia Pacific Institute Of Information Technology and Staffordshire 39 University,London
} }; void admin2::get_authentic1() {
void admin2::get_authentic()//mathcing the username and passowrd { char login_un[50], login_pw[50], username[50], password[50];
}
Asia Pacific Institute Of Information Technology and Staffordshire 41 University,London
//
} void admin2::search_by_id(fstream & ino)//used for searching the file { ino.clear(); int id_verify; int pro=0; cout<<"TYPE YOUR ID"; cin>>id_verify; ino.seekg(0); while(ino.read((char *) (this),sizeof(admin2))) { if(id==id_verify) { cout<<id; pro=pro+1; put_data (); } } if(pro==0) cout<<"THERE IS NO ID \n\n\n\n"; cout<<"\n\n\n\n"; //ino.close();
Asia Pacific Institute Of Information Technology and Staffordshire 43 University,London
ino.seekg(0); while(ino.read((char *) (this),sizeof(admin2))) { int l4=strcmp(name1,desinigation ); if(l4==0) { exp=exp+1; total=total+id ; put_data (); cntr=cntr+1; } } if(exp==0) { cout<<"THERE IS NO ID OF THIS NAME\n\n\n"; } else { cout<<"\n"; //cout<<"YOU CAN SEE HERE ALL INFORMATION }
Asia Pacific Institute Of Information Technology and Staffordshire 44 University,London
ino.seekg(0); while(ino.read((char *) (this),sizeof(admin2))) { int l4=strcmp(name1,department); if(l4==0) { exp=exp+1; total=total+id ; put_data (); cntr=cntr+1; } } if(exp==0) { cout<<"THERE IS NO ID OF THIS NAME\n\n\n"; } else { cout<<"\n"; //cout<<"YOU CAN SEE HERE ALL INFORMATION } cout<<"\n\n"; cout<<"\n"<<"*********************MOVE ABOVE TO CHECK RESULTS*********************"; cout<<"\n"; cout<<"\n"; cout<<"\n";
admin2 admin2_object;//here making the object int choice; char user_name[23]; char user_password[23]; fstream inoutfile; inoutfile.open ("stock.dat",ios::ate| ios::in | ios::out|ios::binary); r: cout<<"\n\t========================================== ======================"; cout<<"\t\t------------Welcome to Apiit Managment System----------|\n"; cout<<"\t=========================================== =====================\n\n\n"; cout<<"\t\t==>ENTER 1 TO ADMIN LOGIN \n\n\n"; cout<<"\t\t==>ENTER 2 TO FACULTY LOGIN \n\n\n"; cout<<"\t\t==>ENTER 3 TO HELP \n\n\n"; cout<<"\t\t==>ENTER 4 TO MAIN \n\n\n";
Asia Pacific Institute Of Information Technology and Staffordshire 48 University,London
system("cls"); if(choice==1) { cout<<"Enter the USERNAME :"; cout<<setw(100);cin>>user_name;cout<<"\n"; printf("Enter the PASSWORD int i=0; while(i<5) { user_password[i]=getch(); if(user_password[i]=='\b') { i=i-2; printf("\b \b"); } else putch('*'); i++; } user_password[5]='\0'; cout<<setw(100); :");
cout<<"\n\t========================================== ======================="; cout<<"\n\t========================================== ======================="; cout<<"\t\t|| Enter 1 WANNA TO SEE ALL CONTENT OF THE FILE ||\n"; cout<<"\t|| Enter 2 WANNA TO ADD THE CONTENT OF THE FILE ||\n"; cout<<"\t|| Enter 3 WANNA TO SEARCH THE CONTENT OF THE FILE ||\n"; cout<<"\t|| Enter 4 WANNA TO DELETE THE CONTENT OF THE FILE ||\n"; cout<<"\t|| Enter 5 WANNA TO EDIT THE PARTICULAR CONTENT ||\n"; cout<<"\t|| Enter 6 FOR MAIN MENU ||\n"; cout<<"\t|| ||"; cout<<"\n\t========================================== ======================="; cout<<"\n\t========================================== =======================";
cout<<"\n\n"; cout<<"THE VALUE YOU ENTERED FROM KEY BOARD IS:"; cin>>cho_ice;
Asia Pacific Institute Of Information Technology and Staffordshire 50 University,London
case 5: { char ck; int nol=0,location; int product,count=0; char pr[10]; cout<<"ENTER YOUR PRODUCT ID HERE: "; cin>>product; inoutfile.seekg(0); while(inoutfile.read((char *) & admin2_object,sizeof admin2_object)) { nol=nol+1; if(admin2_object.id==product) { count++;
cout<<"ENTER NEW VALUES INFORMATION"<<"\n\n"<<"\n\n"; cout<<"\n\nEntre your Qualification"; char dir[]="director"; char lec[]="lecture"; char group[]="groupleader"; char doc[]="doctorate"; char pro[]="professor"; char asspro[]="assistantprofessor"; char associatepro[]="associateprofessor"; char srlecture[]="srlecturer";
l:
cout<<"\n\t============================================== =================="; cout<<"\t\t| SELECT YOUR QUALIFICATION HERE |\n"; cout<<"\t=========================================== =====================\n\n\n";
cout<<"\n\t========================================== =======================";
Asia Pacific Institute Of Information Technology and Staffordshire 54 University,London
} case 7: { cout<<"Congratulation"<<endl; cout<<" Your Desigination is "<<endl; strcpy(admin2_object.desinigation,dir); cout<<admin2_object.desinigation; admin2_object.salary=(10000 + 0.12*1000+ 0.05*10000)*12; cout<<" Your Anuual Package is "; setw(50);cout<<admin2_object.salary; break;
} default:
Asia Pacific Institute Of Information Technology and Staffordshire 57 University,London
cin.ignore(INT_MAX, '\n'); char business[]="business"; char information_Networking_technology[]="information_Networking_technolo gy"; char application_development[]="application_development"; char multimedia[]="multimedia";
p: cin.ignore(INT_MAX, '\n');
cout<<"\n\t============================================== =================="; cout<<"\t\t| SELECT YOUR DEPARTMENT HERE |\n"; cout<<"\t=========================================== ===================\n\n\n"; cout<<"\n\t========================================== ======================="; cout<<"\n\t========================================== ======================="; cout<<"\t\t|| Enter 1 BUSINESS ||\n"; cout<<"\t|| Enter 2 INFORMATION NETWORKING TECHNOLOGY ||\n";
Asia Pacific Institute Of Information Technology and Staffordshire 58 University,London
cout<<"\n\t========================================== ======================="; cout<<"\n\t========================================== ======================="; cout<<"\n\nEntre your Department "<<endl; int choice7; cin>>choice7; switch(choice7) { case 1: {
strcpy(admin2_object.department,business); cout<<"It is a group leader if yes then press 1 ortherwise 2"; int count; cin>>count; if(count==1 && admin2_object.count1==0) { admin2_object.count1++; cout<<"Congrtaulation u get the post of Group leader";cout<<endl; cout<<"Now your salary is "; admin2_object.salary= (50000 + 0.30*30000+ 0.10*30000)*12 ; cout<<" Your Anuual Package is "; cout<<setw(50); cout<<admin2_object.salary; } else { cout<<"sorry group leader is already there"; break; } break;
Asia Pacific Institute Of Information Technology and Staffordshire 59 University,London
case 2: { strcpy(admin2_object.department,information_Networking_technolog y); cout<<"It is a group leader if yes then press 1 ortherwise 2"; int count; cin>>count; if(count==1 && admin2_object.count1==0) { admin2_object. count1++; cout<<"Congrtaulation u get the post of Group leader";cout<<endl; cout<<"Now your salary is "; admin2_object.salary= (50000 + 0.30*30000+ 0.10*30000)*12 ; cout<<" Your Anuual Package is "; cout<<setw(50); cout<<admin2_object.salary; } else { cout<<"sorry group leader is already there"; break; } break; } case 3: { strcpy(admin2_object.department,application_development); cout<<"It is a group leader if yes then press 1 ortherwise 2";
Asia Pacific Institute Of Information Technology and Staffordshire 60 University,London
} } while(cho_ice!=8); } if(choice==2)
Asia Pacific Institute Of Information Technology and Staffordshire 62 University,London
} } while(ch_oice!=5);
if(choice==3) { int choice1; admin1 admin1_object; admin2 admin2_object; admin1 *address_admin1; cout<<"\n\t========================================== ======================";
Asia Pacific Institute Of Information Technology and Staffordshire 64 University,London
} }
Asia Pacific Institute Of Information Technology and Staffordshire 65 University,London