Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include<iostream>
- #include<fstream>
- #include<string>
- using namespace std;
- string lookUpTitle();
- int lookUpISBN(); //Bartolini's Function (uses the string Title to find the int ISBN in file)
- char isBookAvailable();
- int _tmain(int argc, _TCHAR* argv[])
- {
- int choiceNum, userISBN, cardNum, posValue, fileLength;
- string userTitle;
- char available;
- do
- {
- cout << "What would you like to search by (1 = ISBN, 2 = Title, 3 = Quit)?: ";
- cin >> choiceNum;
- if(choiceNum == 1)
- {
- lookUpTitle();
- cout << "The title of the book is: ";
- available = isBookAvailable();
- if(available == 'Y')
- {
- cout << "The book is available.";
- }
- else
- {
- cout << "The book is unavailable.";
- }
- }
- if(choiceNum == 2)
- {
- lookUpISBN();
- cout << "The ISBN of the book is: ";
- available = isBookAvailable();
- if(available == 'Y')
- {
- cout << "The book is available.";
- }
- else
- {
- cout << "The book is unavailable.";
- }
- }
- }
- while(!(choiceNum == 3));
- return 0;
- }
Add Comment
Please, Sign In to add comment