Guest User

Untitled

a guest
Apr 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1.  
  2. #include "stdafx.h"
  3. #include<iostream>
  4. #include<fstream>
  5. #include<string>
  6. using namespace std;
  7.  
  8. string lookUpTitle();
  9. int lookUpISBN(); //Bartolini's Function (uses the string Title to find the int ISBN in file)
  10. char isBookAvailable();
  11.  
  12. int _tmain(int argc, _TCHAR* argv[])
  13. {
  14. int choiceNum, userISBN, cardNum, posValue, fileLength;
  15. string userTitle;
  16. char available;
  17. do
  18. {
  19. cout << "What would you like to search by (1 = ISBN, 2 = Title, 3 = Quit)?: ";
  20. cin >> choiceNum;
  21. if(choiceNum == 1)
  22. {
  23. lookUpTitle();
  24. cout << "The title of the book is: ";
  25. available = isBookAvailable();
  26. if(available == 'Y')
  27. {
  28. cout << "The book is available.";
  29. }
  30. else
  31. {
  32. cout << "The book is unavailable.";
  33. }
  34. }
  35. if(choiceNum == 2)
  36. {
  37. lookUpISBN();
  38. cout << "The ISBN of the book is: ";
  39. available = isBookAvailable();
  40. if(available == 'Y')
  41. {
  42. cout << "The book is available.";
  43. }
  44. else
  45. {
  46. cout << "The book is unavailable.";
  47. }
  48. }
  49. }
  50. while(!(choiceNum == 3));
  51. return 0;
  52. }
Add Comment
Please, Sign In to add comment