#include <iostream>
using namespace std;
class library 
{
    char name [30],book [50];
    int rollno,d1,m1,y1,d2,m2,y2,d3,m3,y3;
    public:
    void  getdata ()
    {
         cout<<"\nEnter your name : ";
        cin>>name; 
        cout<<name<<endl;
       cout<<"\nEnter your roll number : ";
       cin>>rollno; 
       cout<<rollno<<endl; 
      cout<<"\nEnter the book names"<<endl;
      for(int i=1;i<=5;i++)
       {
        cin>>book; 
        cout<<i<<"."<<book<<endl;
      }
      cout<<"\nEnter the date you taken the books:";
      cin>>d1>>m1>>y1;
      cout<<d1<<"."<<m1<<"."<<y1;
      cout<<"\nEnter the last date :";
      cin>>d2>>m2>>y2;
      cout<<d2<<"."<<m2<<"."<<y2;
      cout<<"\nEnter the submission date:";
       cin>>d3>>m3>>y3; 
     cout<<d3<<"."<<m3<<"."<< y3;
    }
    void check()
    {
        if(d2<d3&&m2<=m3)
         {   
         cout<<"\n\nyour submission date  is over";
         cout<<"\nPay fine  rs20  for late submission"<<endl;
        }
     else
       {
       cout<<"\n\nNo fine";
       }
    }
};
int main() 
{
   library l; 
   l. getdata ();
   l. check ();
   return 0;

}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: