Guest User

Untitled

a guest
Apr 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.22 KB | None | 0 0
  1. void fillCard ( Card cardInfo[],int &numberBooks)
  2. {
  3.         cout<<"Please enter the ID number of the book: ";
  4.         scanf(" %d",&cardInfo[numberBooks].bookID);
  5.         fflush(stdin);
  6.         cout<<endl;
  7.         cout<<"Please enter the title of the book: ";
  8.         scanf(" %s",cardInfo[numberBooks].title );
  9.         fflush(stdin);
  10.         cout<<endl;
  11.         cout<<"Please enter the authors name: ";
  12.         scanf(" %s",cardInfo[numberBooks].authors[numberBooks]);
  13.         fflush(stdin);
  14.         cout <<endl;
  15.         cout <<"Please enter the ISBN-10 of the book you wish to add, if the ISBN contains an X substitute the X for the value of 10: ";
  16.         cin >> cardInfo[numberBooks].isbn_10;
  17.         scanf(" %d",&cardInfo[numberBooks].isbn_10);
  18.         fflush(stdin);
  19.         cout <<endl;
  20.         cout <<"Please enter the ISBN-13 of the book you wish to add: " ;
  21.         scanf(" %d",&cardInfo[numberBooks].isbn_13);
  22.         fflush(stdin);
  23.         cout<<endl;
  24.         cout << "Please enter the amount of copies of this books we have : " ;
  25.         scanf(" %d",&cardInfo[numberBooks].copies);
  26.         fflush(stdin);
  27.         cout<<endl;
  28.         cout << "The amount of copies this book has: " << cardInfo[numberBooks].copies << endl;
  29.         cardInfo[numberBooks].numberBorrowers=0;
  30.         numberBooks++;
  31. }
Add Comment
Please, Sign In to add comment