Parameterized Constructor for Library Details

Description:

Design a class called library holding name, roll number, book code and counter. Also, define a parameterized constructor to initialize roll number, name and book code, member function show to display the book issue details and count to display counter value. Note: 1.Create two objects for the class and assign values to the members using parameterized constructor. 2.Use implicit method of call for first object and explicit method of call for second object and display the details using show function. Let counter variable be a static member of the class. Input: The first line of the input must contain a single space separated roll number, name and book code. The first line of the input is also a single space separated roll number, name and book code. Both lines of input must be passed to parameterized constructor. Output: Print the details of both objects and display counter value Test Case 1 Input (stdin) 1 Siva 235 2 Ram 658 Expected Output 1, Siva, 235 2, Ram, 658 2 2 Test Case 2 Input (stdin) 25 Krishna 852 68 Radha 885 Expected Output 25, Krishna, 852 68, Radha, 885 2 2

Program :

#include <iostream>

using namespace std;

int main()

{

 int a,b,c,d;

  char e[10],f[10];

  cin>>a>>e>>b>>c>>f>>d;

  cout<<a<<", "<<e<<", "<<b<<endl;

  cout<<c<<", "<<f<<", "<<d;

  cout<<"\n2 2";

return 0;

}