• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
projectsgeek

ProjectsGeek

Download Mini projects with Source Code, Java projects with Source Codes

  • Home
  • Java Projects
  • C++ Projects
  • VB Projects
  • PHP projects
  • .Net Projects
  • NodeJs Projects
  • Android Projects
    • Project Ideas
      • Final Year Project Ideas
      • JSP Projects
  • Assignment Codes
    • Fundamentals of Programming Language
    • Software Design Laboratory
    • Data Structure and Files Lab
    • Computer Graphics Lab
    • Object Oriented Programming Lab
    • Assembly Codes
  • School Projects
  • Forum

Friend Function Implementation using C++

September 7, 2011 by ProjectsGeek Leave a Comment

Friend Function Implementation using C++
#include
#include #include
#include
#include
int i=0;
int idno;
class student
{
public:
friend void issue ();
friend void  ret ();
};
class lib
{
char name[10];
int roll; 

public:

int status;
lib();
void idinfor();
friend void issue ();
friend void  ret ();
};
lib::lib()
{
status=0;
}
void lib::idinfor()
{
i++;
cout<<“\n\n\t\t ENTER UR NAME…”;
gets(name);
cout<<“\n\n\t\t ENTER UR ROLL NO…”;
cin>>roll;
cout<<“\n\n\t\t UR ID NUMBER IS….”<<i+1998;< p=””>

}
void issue(int status)
{

int bn;
cout<<“\n\n\t\t LIST OF AVAILABLE BOOKS FOR U”;
cout<<“\n\n\t\t PRESS 1 BALA\n\t\t PRESS 2 VENU\n\t\t PRESS 3 OOPS\n\t\t PRESS 4 MAT”;
cout<<“\n\n\t\t ENTER UR CHOICE”;
cin>>bn;

if(status<3)
    {
cout<<“\n\n\t\t BOOK IS AVAILABLE FOR U”;
}
else
{
cout<<“\n\n\t\t BOOK IS NOT AVAILABLE FOR U”;
cout<<“\n\n\t\t U CANT ISSUE MORE THAN TWO BOOKS”;
}
}
void ret()
{
cout<<“\n\n\t\t THANK YOU”;
}
void main()
{
lib l[10];
int ch;
clrscr();
do
{
cout<<“\n\t\t PRESS 1 FOR UR ID NUMBER INFORMATION”;
cout<<“\n\t\t PRESS 2 FOR ISSUE A NEW BOOK “;
cout<<“\n\t\t PREES 3 FOR RETURN A BOOK “;
cout<<“\n\t\t PRESS 4 FOR EXIT”;
cout<<“\n\t\t ENTER UR CHOICE…”;
cin>>ch;
switch(ch)
{
case 1:
clrscr();
l[i].idinfor();
break;
case 2:
clrscr();
cout<<“\n\n\t\tENTER UR ID NO…”;
cin>>idno;
issue(l[i].status);
l[i].status++;
break;
case 3:
clrscr();
cout<<“\n\n\t\tENTER UR ID NO…”;
cin>>idno;
ret();
l[i].status–;
break;
case 4:
exit(0);
break;
}
}while(ch!=4);
}

Other Projects to Try:

  1. Matrix Operations in C Language
  2. Weather report program in c++ using constructor
  3. Operator Overloading on String Functions C++ Language
  4. Student Database in C Language
  5. How to Implement Hash Table using C language

Filed Under: Computer Graphics Tagged With: Computer Graphics

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Tags

.Net Projects Download Android Project Ideas Android Projects Angular 2 Assembly Codes C # Projects C & C++ Projects C++ Projects Class Diagrams Computer Graphics Database Project Data Mining Projects DataScience Projects Datastructure Assignments Download Visual Basic Projects Electronics project Hadoop Projects Installation Guides Internet of Things Project IOS Projects Java Java Interview Questions Java Projects JavaScript JavaScript Projects java tutorial JSON JSP Projects Mechanical Projects Mongodb Networking Projects Node JS Projects OS Problems php Projects Placement Papers Project Ideas Python Projects seminar and presentation Struts

Search this Website


Footer

Download Java Project
Download Visual Basic Projects
Download .Net Projects
Download VB Projects
Download C++ Projects
Download NodeJs Projects
Download School Projects
Download School Projects
Ask Questions - Forum
Latest Projects Ideas
Assembly Codes
Datastructure Assignments
Computer Graphics Lab
Operating system Lab
australia-and-India-flag
  • Home
  • About me
  • Contact Form
  • Submit Your Work
  • Site Map
  • Privacy Policy