You are on page 1of 12

Shaheed Zulfikar Ali Bhutto Institute of Science & Technology

COMPUTER SCIENCE DEPARTMENT

Total Marks: _____________

Obtained Marks: _____________

Date: _____________

Object oriented
programming
(Lab)
Midterm Project

[Library Management System]

Submitted To: Muhammad Touqeer Ali


__________________________________________________________________________

Student Name: Muhammad Zain Zafar, Hammad mehmood

Reg. Number: 1912267, 1912249

Object oriented programming (Lab) BSCS-2A SZABIST-ISB


Shaheed Zulfikar Ali Bhutto Institute of Science & Technology

COMPUTER SCIENCE DEPARTMENT

Introduction of project:
Our project is simply based on library management system in
which we provide student online facility to take the book from library
online and read if he don’t want to sit in the university or collage
library and along with books university also provide newspapers to
student to aware with the current situation of country.

Group member’s participation:


We both work together at same place.

Reg. No. Name Group members participation

1912249 Hammad Mehmood Work together

1912267 Muhammad Zain Zafar Work together

CODE:

#include<iostream>
using namespace std;

class News // news class started


{
private:
char Criket;
char Jobs;
char Politics;

Object oriented programming (Lab) BSCS-2A SZABIST-ISB


Shaheed Zulfikar Ali Bhutto Institute of Science & Technology

COMPUTER SCIENCE DEPARTMENT

public:
News()
{
Criket;
Jobs;
Politics;
}
New(char c,char j,char p)
{
Criket=c;
Jobs=j;
Politics=p;
}
void Nset()
{
cout<<"Enter C for Criket News: "<<endl;
cout<<"Enter J for Jobs news: "<<endl;
cout<<"Enter P for Political news: "<<endl;
char S;
cin>>S;
if(S=='C' || S=='c')
{
cout<<"You select Criket news---"<<endl;
}
else if(S=='J' || S=='j')
{
cout<<"you select Jobs news---"<<endl;
}
else if(S=='P' || S=='p')
{
cout<<"you select Polical news---"<<endl;
}

Object oriented programming (Lab) BSCS-2A SZABIST-ISB


Shaheed Zulfikar Ali Bhutto Institute of Science & Technology

COMPUTER SCIENCE DEPARTMENT

else
{
cout<<"wrong input";
}
}

};
// News class ended

class Book
//books class started
{
private:
char E,M,H,P,U;
public:
Book()
{
E;
M;
H;
P;
U;
}
New(char e,char m,char h,char pks,char u)
{
E=e;
M=m;
H=h;
P=pks;
U=u;
}
void Bset()
{
cout<<"Press E for English"<<endl;

Object oriented programming (Lab) BSCS-2A SZABIST-ISB


Shaheed Zulfikar Ali Bhutto Institute of Science & Technology

COMPUTER SCIENCE DEPARTMENT

cout<<"Press M for Maths"<<endl;


cout<<"Press U for Urdu"<<endl;
cout<<"Press P for Pak study"<<endl;
char S;
cin>>S;
if(S=E)
{
system ("cls");
cout<<"***You select English book***"<<endl;
cout<<"Your reading time is 3 Hours";
cout<<endl;
cout<<endl;
cout<<"Other wise 500 fine Charged";
cout<<endl;
cout<<endl;
}
else if(S=='M' || S=='m')
{
system ("cls");
cout<<"***you select maths book***"<<endl;
cout<<"Your Reading time is 2 Hours";
cout<<endl;
cout<<endl;
cout<<"Otherwise 500 fine Charged";
cout<<endl;
cout<<endl;
}
else if(S=='U' ||S=='u')
{
system ("cls");
cout<<"***you select Urdu book***"<<endl<<endl;
cout<<"Your Reading time is 2 Hours";
cout<<endl;
cout<<endl;

Object oriented programming (Lab) BSCS-2A SZABIST-ISB


Shaheed Zulfikar Ali Bhutto Institute of Science & Technology

COMPUTER SCIENCE DEPARTMENT

cout<<"Otherwise 500 fine Charged";


cout<<endl;
cout<<endl;
}
else if(S=='P' || S=='p')
{
system ("cls");
cout<<"***you select Pakistan Study
book***"<<endl;
cout<<"Your Reading time is 2 Hours";
cout<<endl;
cout<<endl;
cout<<"Otherwise 500 fine Charged";
cout<<endl;
cout<<endl;
}
else
{
system ("cls");
cout<<"wrong input------!"<<endl;
}
}
void Bshow()
{
cout<<"enter E for English book: "<<E<<endl;
cout<<"Enter M for maths book: "<<M<<endl;
cout<<"Enter U for usrdu book: "<<U<<endl;
cout<<"Enter H for history book: "<<H<<endl;
cout<<"Enter P for Pakistan study: "<<P<<endl;

};

Object oriented programming (Lab) BSCS-2A SZABIST-ISB


Shaheed Zulfikar Ali Bhutto Institute of Science & Technology

COMPUTER SCIENCE DEPARTMENT

//
books class ended

class library
{
private:
int Reg,LID;
string name,classname;
public:
library()
{
name="";
classname="";
Reg=0;
LID=0;
}
library(int reg, int lid, string n, string cn)
{
Reg=reg;
LID=lid;
name=n;
classname=cn;
}

void set()
{
cout<<"Enter your reg no. ";
cin>>Reg;
cout<<"Enter your name ";
cin>>name;
cout<<"Enter your library id: ";

Object oriented programming (Lab) BSCS-2A SZABIST-ISB


Shaheed Zulfikar Ali Bhutto Institute of Science & Technology

COMPUTER SCIENCE DEPARTMENT

cin>>LID;
cout<<"Enter your class name ";
cin>>classname;

char A;

cout<<endl;
cout<<"Enter your Selection "<<endl;
cout<<"Enter N for Newspapper Reading or B for Book reading: ";
cin>>A;
if(A=='n'||A=='N')
{
system ("cls");
cout<<"You Select Newspapper readung"<<endl;
News N;
N.Nset();
}

else if(A=='B'||A=='b')
{
system ("cls");
cout<<"You Select Book reading"<<endl;
Book B;
B.Bset();
}
else
{
cout<<"Your Enter Wrong one Programme Ended"<<endl;
}

Object oriented programming (Lab) BSCS-2A SZABIST-ISB


Shaheed Zulfikar Ali Bhutto Institute of Science & Technology

COMPUTER SCIENCE DEPARTMENT

};

int main()
{
Main:
cout<<endl;
cout<<" -------------------------------- ";
cout<<endl;
cout<<" |**Library Managment System**| ";
cout<<endl;
cout<<" ____________ ";
cout<<endl;
cout<<endl;

library L;
L.set();

// ImPortant Instructions
{
cout<<"Please Read Below Statements ";
cout<<endl;
cout<<endl;
cout<<"There are same Rules And Regulations as below ";
cout<<endl;
cout<<endl;

cout<<" 1.Eating is not Allowed in Library.";


cout<<endl;
cout<<endl;
cout<<" 2.Drinking is not Allowed in Library.";
cout<<endl;
cout<<endl;

Object oriented programming (Lab) BSCS-2A SZABIST-ISB


Shaheed Zulfikar Ali Bhutto Institute of Science & Technology

COMPUTER SCIENCE DEPARTMENT

cout<<" 3.Don't Disturbed other Students";


cout<<endl;
cout<<endl;
cout<<" 4.keep clean library";
cout<<endl;
cout<<endl;
}
char slect;
cout<<"If you want to read another book or Newspapper Enter Y
If not Enter N: ";
cin>>slect;
system ("cls");
if(slect=='y')
{
goto Main;
}
return 0;
}

Output:

Object oriented programming (Lab) BSCS-2A SZABIST-ISB


Shaheed Zulfikar Ali Bhutto Institute of Science & Technology

COMPUTER SCIENCE DEPARTMENT

Object oriented programming (Lab) BSCS-2A SZABIST-ISB


Shaheed Zulfikar Ali Bhutto Institute of Science & Technology

COMPUTER SCIENCE DEPARTMENT

Conclusion:
The conclusion of project is that this is very useful for students to safe
their time. If the student is at home and he want a book urgent than he can take
book online though this system and this can safe his time to come university for
book. And it is also used by student’s parents to read newspaper daily.

Object oriented programming (Lab) BSCS-2A SZABIST-ISB

You might also like