Advertisement
Guest User

Untitled

a guest
Apr 12th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 21.76 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <sstream>
  4. #include <vector>
  5. #include <stdlib.h>
  6. #include "Date.h"
  7.  
  8. using namespace std;
  9.  
  10. enum Genre
  11. {
  12.     FICTION = 1,
  13.     HORROR,
  14.     CRIME,
  15.     DRAMA,
  16.     SCIFI,
  17.     THRILLER,
  18.     BIO
  19. };
  20.  
  21. class Book
  22. {
  23.  
  24. private:
  25.     string name;
  26.     string ISBN;
  27.     string author;
  28.     Genre genre;
  29.     string defaultISBN = "000-000-000-F";
  30.     string defaultName = "Default";
  31.     bool checkedOut;
  32.  
  33. public:
  34.  
  35.     Book(string name,string ISBN,string author,Genre genre)
  36.         :name(name),ISBN(ISBN),author(author),checkedOut(false),genre(genre)
  37.     {
  38.         if(!validISBN(ISBN))
  39.         {
  40.             ISBN = defaultISBN;
  41.             cout << "not a valid ISBN, defaulting the ISBN to : " << defaultISBN << endl;
  42.         }
  43.         if(!validAuthor(author))
  44.         {
  45.             author = defaultName;
  46.             cout << "not a valid name,defaulting the author to :" << defaultName << endl;
  47.         }
  48.     }
  49.     Book() {}
  50.     Book(const Book& other)
  51.     {
  52.         name = other.name;
  53.         ISBN = other.ISBN;
  54.         author = other.author;
  55.         genre = other.genre;
  56.         checkedOut = false;
  57.  
  58.         if(!validISBN(ISBN))
  59.         {
  60.             ISBN = defaultISBN;
  61.             cout << "not a valid ISBN, defaulting the ISBN to : " << defaultISBN << endl;
  62.         }
  63.         if(!validAuthor(author))
  64.         {
  65.             author = defaultName;
  66.             cout << "not a valid name,defaulting the author to :" << defaultName << endl;
  67.         }
  68.     }
  69.  
  70.     string getName() const
  71.     {
  72.         return name;
  73.     }
  74.     string getISBN() const
  75.     {
  76.         return ISBN;
  77.     }
  78.     string getAuthor()const
  79.     {
  80.         return author;
  81.     }
  82.     bool isCheckedOut() const
  83.     {
  84.         return checkedOut;
  85.     }
  86.     bool checkOutBook()
  87.     {
  88.         if(checkedOut)
  89.         {
  90.             cout << "sorry book already checked out" << endl;
  91.             return false;
  92.         }
  93.         else
  94.         {
  95.             checkedOut = true;
  96.             return true;
  97.         }
  98.     }
  99.     void returnBook()
  100.     {
  101.         checkedOut = true;
  102.     }
  103.  
  104.     bool operator==(const Book& other)
  105.     {
  106.         return ISBN == other.ISBN;
  107.     }
  108.  
  109.     bool operator!=(const Book& other)
  110.     {
  111.         return !(ISBN == other.ISBN);
  112.     }
  113.  
  114.     friend ostream& operator<<(ostream& os,const Book& other);
  115.  
  116.     bool validISBN(string i)
  117.     {
  118.         int second;
  119.         int third;
  120.         int fouth;
  121.         int fifth;
  122.  
  123.         for(int j = 0; j < i.size(); j++)
  124.         {
  125.             if(i.at(j) == '-')
  126.             {
  127.                 second = j;
  128.                 break;
  129.             }
  130.             if(!isdigit(i.at(j)))
  131.             {
  132.                 return false;
  133.             }
  134.         }
  135.  
  136.         for(int j = second+1; j < i.size(); j++)
  137.         {
  138.             if(i.at(j) == '-')
  139.             {
  140.                 third = j;
  141.                 break;
  142.             }
  143.             if(!isdigit(i.at(j)))
  144.             {
  145.                 return false;
  146.             }
  147.         }
  148.  
  149.         for(int j = third+1; j < i.size(); j++)
  150.         {
  151.             if(i.at(j) == '-')
  152.             {
  153.                 fifth = j;
  154.                 break;
  155.             }
  156.  
  157.             if(!isdigit(i.at(j)))
  158.             {
  159.                 return false;
  160.             }
  161.         }
  162.  
  163.         for(int j = fifth+1; j < i.size(); j++)
  164.         {
  165.             if(i.at(j) == '-')
  166.             {
  167.                 return false;
  168.             }
  169.  
  170.             if(isdigit(i.at(j)))
  171.             {
  172.                 return false;
  173.             }
  174.         }
  175.         return true;
  176.     }
  177.  
  178.     bool validAuthor(string n)
  179.     {
  180.         for(int i = 0; i < n.size(); i++)
  181.         {
  182.             if(isdigit(n.at(i)))
  183.             {
  184.                 return false;
  185.             }
  186.             return true;
  187.         }
  188.     }
  189. };
  190.  
  191. ostream& operator<<(ostream& os,const Book& other)
  192. {
  193.     os << "Name: " << other.getName() << " Author: " << other.getAuthor() << " ISBN: " <<other.getISBN() << endl;
  194.     return os;
  195. }
  196.  
  197. class Patron
  198. {
  199.  
  200. public:
  201.  
  202.     string name;
  203.     string cardNumber;
  204.     int fees;
  205.     bool owesFees;
  206.  
  207.     Patron(string name,string cardNumber):
  208.         name(name),cardNumber(cardNumber),fees(0),owesFees(false)
  209.     {}
  210.     Patron() {}
  211.     Patron(const Patron& other)
  212.     {
  213.  
  214.         name = other.name;
  215.         cardNumber = other.cardNumber;
  216.         fees = other.fees;
  217.         owesFees = other.owesFees;
  218.     }
  219.  
  220.     string getName() const
  221.     {
  222.         return name;
  223.     }
  224.     string getCardNumber() const
  225.     {
  226.         return cardNumber;
  227.     }
  228.     int getFees() const
  229.     {
  230.         return fees;
  231.     }
  232.     bool getOwesFees() const
  233.     {
  234.         return owesFees;
  235.     }
  236. };
  237.  
  238. bool checkFees(const Patron& p)
  239. {
  240.  
  241.     return p.getOwesFees();
  242. }
  243.  
  244. class Library
  245. {
  246.  
  247. public:
  248.  
  249.     vector<Patron> patrons;
  250.     vector<Book> books;
  251.     vector<Dates::Date> dates;
  252.     Dates::Date today;
  253.  
  254.     struct Transaction
  255.     {
  256.         Patron patron;
  257.         Book book;
  258.         Dates::Date dateTaken;
  259.         Dates::Date dateDue;
  260.     };
  261.  
  262.     vector<Transaction> transactions;
  263.  
  264.     void setDate(Dates::Date d)
  265.     {
  266.  
  267.         today = d;
  268.     }
  269.  
  270.     void printDate()
  271.     {
  272.  
  273.         cout << "Today's date :" <<
  274.              today.getDay() << "/" << today.getMonth() <<  "/" << today.getYear().y << endl;
  275.     }
  276.  
  277.     bool addPatron(ofstream& storePatrons)
  278.     {
  279.         string name;
  280.         string cardNumber;
  281.         char choice;
  282.  
  283.         cout << "Enter the name of the Patron" << endl;
  284.         getline(cin,name);
  285.  
  286.         cout << "Enter card Number of Patron" << endl;
  287.         getline(cin,cardNumber);
  288.  
  289.         for(int i = 0; i < patrons.size(); i++)
  290.         {
  291.             if(name == patrons[i].getName())
  292.             {
  293.                 cout << "the library already has a patron by that name"
  294.                      << "is it another person? type y for yes n for no" << endl;
  295.                 cin >> choice;
  296.                 cin.get();
  297.                 if(choice == 'n')
  298.                 {
  299.                     cout << "what the heck" << endl;
  300.                     return false;
  301.                 }
  302.             }
  303.             if(cardNumber == patrons[i].getCardNumber())
  304.             {
  305.                 cout << "false : cardNumber = cardnumber" << endl;
  306.                 return false;
  307.             }
  308.         }
  309.         storePatrons << name << endl;
  310.         storePatrons << cardNumber << endl;
  311.         patrons.push_back(Patron(name,cardNumber));
  312.         return true;
  313.  
  314.     }
  315.     bool addBook(ofstream &storeBooks)
  316.     {
  317.  
  318.         string name;
  319.         string author;
  320.         string ISBN;
  321.         Genre genre;
  322.         char choice;
  323.  
  324.         cout << "Enter the name of the Book" << endl;
  325.         getline(cin,name);
  326.  
  327.         cout << "Enter name of the Author" << endl;
  328.         getline(cin,author);
  329.  
  330.         cout << "Enter ISBN" << endl;
  331.         getline(cin,ISBN);
  332.  
  333.         // implement genre ask user to choose genre
  334.         genre = BIO;
  335.  
  336.         for(int i = 0; i < books.size(); i++)
  337.         {
  338.             if(name == books.at(i).getName() && author == books.at(i).getAuthor())
  339.             {
  340.                 cout << "the library already has a book by that Author"
  341.                      << "is it another book? type y for yes n for no" << endl;
  342.                 cin >> choice;
  343.                 cin.get();
  344.                 if(choice == 'n')
  345.                 {
  346.                     cout << "first false" << endl;
  347.                     return false;
  348.                 }
  349.             }
  350.             if(ISBN == books.at(i).getISBN())
  351.             {
  352.                 cout << "sec false" << endl;
  353.                 return false;
  354.             }
  355.         }
  356.  
  357.         cout << "adding book" << endl;
  358.         books.push_back(Book(name,ISBN,author,BIO));
  359.         storeBooks << name << endl;
  360.         storeBooks << ISBN << endl;
  361.         storeBooks << author << endl;
  362.         return true;
  363.     }
  364.  
  365.     void readFile(ifstream& in,ifstream& inPatron,ifstream& inTrans)
  366.     {
  367.  
  368.         // read in Books
  369.         string name;
  370.         string ISBN;
  371.         string author;
  372.         Genre genre;
  373.  
  374.         while(in)
  375.         {
  376.             getline(in,name);
  377.             if(!in)
  378.             {
  379.                 break;
  380.             }
  381.             getline(in,ISBN);
  382.             getline(in,author);
  383.             genre = HORROR;
  384.             Book temp(name,ISBN,author,genre);
  385.             books.push_back(temp);
  386.  
  387.         }
  388.         // read in Patrons
  389.  
  390.         string patronName;
  391.         string cardNumber;
  392.  
  393.         while(inPatron)
  394.         {
  395.             getline(inPatron,patronName);
  396.             if(!inPatron)
  397.             {
  398.                 break;
  399.             }
  400.             getline(inPatron,cardNumber);
  401.             Patron temp(patronName,cardNumber);
  402.             patrons.push_back(temp);
  403.         }
  404.  
  405.         // read in Transactions
  406.  
  407.         while(inTrans)
  408.         {
  409.  
  410.             int day;
  411.             Dates::Month month;
  412.             int year;
  413.             string dayStr;
  414.             string monthStr;
  415.             string yearStr;
  416.             stringstream ss;
  417.  
  418.             getline(inTrans,dayStr,',');
  419.             if(!inTrans){
  420.                 break;
  421.             }
  422.             ss << dayStr;
  423.             ss >> day;
  424.             ss.str( std::string() );
  425.             ss.clear();
  426.  
  427.             getline(inTrans,monthStr,',');
  428.             int monthInt;
  429.             ss << monthStr;
  430.             ss >> monthInt;
  431.             month = Dates::Month(monthInt);
  432.             ss.str( std::string() );
  433.             ss.clear();
  434.  
  435.             getline(inTrans,yearStr,',');
  436.             ss << yearStr;
  437.             ss >> year;
  438.             ss.str( std::string() );
  439.             ss.clear();
  440.             Year yr(year);
  441.  
  442.             Dates::Date dateTaken(day,month,yr);
  443.  
  444.             getline(inTrans,dayStr,',');
  445.             ss << dayStr;
  446.             ss >> day;
  447.             ss.str( std::string() );
  448.             ss.clear();
  449.  
  450.             getline(inTrans,monthStr,',');
  451.             ss << monthStr;
  452.             ss >> monthInt;
  453.             month = Dates::Month(monthInt);
  454.             ss.str( std::string() );
  455.             ss.clear();
  456.  
  457.             getline(inTrans,yearStr,',');
  458.             ss << yearStr;
  459.             ss >> year;
  460.             ss.str( std::string() );
  461.             ss.clear();
  462.             yr = Year(year);
  463.  
  464.             Dates::Date dateDue(day,month,yr);
  465.  
  466.             string cardNumber;
  467.             string ISBN;
  468.  
  469.             getline(inTrans,cardNumber,',');
  470.             Patron p;
  471.  
  472.             for(int i = 0; i < patrons.size(); i++)
  473.             {
  474.                 if(cardNumber == patrons.at(i).getCardNumber())
  475.                 {
  476.                     p = patrons.at(i);
  477.                 }
  478.             }
  479.             getline(inTrans,ISBN);
  480.             Book b;
  481.  
  482.             for(int i = 0; i < books.size(); i++)
  483.             {
  484.                 if(ISBN == books.at(i).getISBN())
  485.                 {
  486.                     b = books.at(i);
  487.                 }
  488.             }
  489.  
  490.             Transaction t;
  491.             t.book = b;
  492.             t.patron = p;
  493.             t.dateTaken = dateTaken;
  494.             t.dateDue = dateDue;
  495.  
  496.             transactions.push_back(t);
  497.         }
  498.  
  499.         // check if book is in the open transactions if it is check it out
  500.         bool checkedOut = false;
  501.         for(int i = 0; i < transactions.size(); i++){
  502.  
  503.             for(int j = 0; j < books.size(); j++){
  504.  
  505.                 if(transactions.at(i).book.getISBN() == books.at(i).getISBN() && !checkedOut){
  506.  
  507.                     books.at(i).checkOutBook();
  508.                     checkedOut = true;
  509.  
  510.                 }
  511.             }
  512.         }
  513.     }
  514.  
  515.     void printBooks()
  516.     {
  517.         for(int i = 0; i < books.size(); i++)
  518.         {
  519.             cout << books.at(i);
  520.             if(books.at(i).isCheckedOut())
  521.             {
  522.  
  523.                 cout << " : Above book checked out,currently not available" << endl;
  524.             }
  525.         }
  526.     }
  527.  
  528.     void printPatrons()
  529.     {
  530.         for(int i = 0; i < patrons.size(); i++)
  531.         {
  532.             cout << patrons.at(i).getName() << " card Number :" << patrons.at(i).getCardNumber() << endl;
  533.         }
  534.     }
  535.  
  536.     bool searchByAuthor(string a)
  537.     {
  538.  
  539.         bool print = true;
  540.         bool found = false;
  541.  
  542.         for(int i = 0; i < books.size(); i++)
  543.         {
  544.  
  545.             if(a == books.at(i).getAuthor())
  546.             {
  547.                 found = true;
  548.                 if(print)
  549.                 {
  550.                     cout << "results found for that author " << endl;
  551.                     print = false;
  552.                 }
  553.  
  554.                 cout << "Author : " << books.at(i).getAuthor() <<
  555.                      " Book title : " << books.at(i).getName() << endl;
  556.             }
  557.         }
  558.         if(found)
  559.         {
  560.             return true;
  561.         }
  562.         else
  563.         {
  564.  
  565.             return false;
  566.         }
  567.  
  568.     }
  569.  
  570.     bool searchByName(string n)
  571.     {
  572.  
  573.         bool print = true;
  574.         bool found = false;
  575.  
  576.         for(int i = 0; i < books.size(); i++)
  577.         {
  578.  
  579.             if(n == books.at(i).getName())
  580.             {
  581.  
  582.                 found = true;
  583.  
  584.                 if(print)
  585.                 {
  586.                     cout << "results found for that name " << endl;
  587.                     print = false;
  588.                 }
  589.  
  590.                 cout << "Author : " << books.at(i).getAuthor() <<
  591.                      " Book title : " << books.at(i).getName() << endl;
  592.             }
  593.  
  594.             if(found)
  595.             {
  596.                 return true;
  597.             }
  598.             else
  599.             {
  600.                 cout << "could not find any results by that name" << endl;
  601.                 return false;
  602.             }
  603.         }
  604.     }
  605.  
  606.     bool searchByISBN(string is)
  607.     {
  608.  
  609.         bool print = true;
  610.         bool found = false;
  611.  
  612.         for(int i = 0; i < books.size(); i++)
  613.         {
  614.  
  615.             if(is == books.at(i).getISBN())
  616.             {
  617.  
  618.                 found = true;
  619.                 if(print)
  620.                 {
  621.                     cout << "results found for that author " << endl;
  622.                     print = false;
  623.                 }
  624.  
  625.                 cout << "Author : " << books.at(i).getAuthor() <<
  626.                      " Book title : " << books.at(i).getName() << endl;
  627.             }
  628.         }
  629.         if(found)
  630.         {
  631.             return true;
  632.         }
  633.         else
  634.         {
  635.  
  636.             return false;
  637.         }
  638.     }
  639.  
  640.     bool addTransaction(ofstream &trans,string ISBN,string cn)
  641.     {
  642.  
  643.         Transaction t;
  644.         bool conditionOne = false;
  645.         bool conditionTwo = false;
  646.  
  647.         for(int i = 0; i < books.size(); i++)
  648.         {
  649.  
  650.             if(ISBN == books.at(i).getISBN())
  651.             {
  652.  
  653.                 conditionOne = true;
  654.                 t.book = books.at(i);
  655.             }
  656.             for(i = 0; i < patrons.size(); i++)
  657.             {
  658.  
  659.                 if(cn == patrons.at(i).getCardNumber())
  660.                 {
  661.  
  662.                     conditionTwo = true;
  663.                     t.patron = patrons.at(i);
  664.                 }
  665.             }
  666.             t.dateTaken = today;
  667.             int todaysDay = today.getDay();
  668.             t.dateDue = Dates::Date(todaysDay+14,Dates::APR,Year(2018));
  669.             if(conditionOne && conditionTwo)
  670.             {
  671.  
  672.                 transactions.push_back(t);
  673.                 trans << t.dateTaken.getDay();
  674.                 trans << ",";
  675.                 trans << t.dateTaken.getMonth();
  676.                 trans << ",";
  677.                 trans << t.dateTaken.getYear().y;
  678.                 trans << ",";
  679.  
  680.                 trans << t.dateDue.getDay();
  681.                 trans << ",";
  682.                 trans << t.dateDue.getMonth();
  683.                 trans << ",";
  684.                 trans << t.dateDue.getYear().y;
  685.                 trans << ",";
  686.  
  687.                 trans << cn;
  688.                 trans << ",";
  689.                 trans << ISBN;
  690.                 trans << endl;
  691.  
  692.                 return true;
  693.             }
  694.             return false;
  695.         }
  696.     }
  697.  
  698.     bool resereveBook()
  699.     {
  700.  
  701.         string ISBN;
  702.         cout << "enter ISBN" << endl;
  703.         cin >> ISBN;
  704.  
  705.         for(int i = 0; i < books.size(); i++)
  706.         {
  707.  
  708.             if(ISBN == books.at(i).getISBN() && !books.at(i).isCheckedOut())
  709.             {
  710.                 books.at(i).checkOutBook();
  711.                 cout << "This book has now been checked out for you" << endl;
  712.  
  713.                 return true;
  714.             }
  715.         }
  716.         return false;
  717.     }
  718. };
  719.  
  720. bool driver()
  721. {
  722.     ofstream storeBooks;
  723.     ofstream storePatrons;
  724.     ofstream storeTransactions;
  725.     ifstream readBooks;
  726.     ifstream readPatrons;
  727.     ifstream readTransactions;
  728.     bool adminMode = false;
  729.     string userName = "admin";
  730.     string password = "admin";
  731.     string userEntered;
  732.     string passEntered;
  733.  
  734.     storeBooks.open("storeBooks.txt",ofstream::app);
  735.     storePatrons.open("storePatrons.txt",ofstream::app);
  736.     storeTransactions.open("storeTransactions.txt",ofstream::app);
  737.     readBooks.open("storeBooks.txt");
  738.     readPatrons.open("storePatrons.txt");
  739.     readTransactions.open("storeTransactions.txt");
  740.  
  741.     Library Library;
  742.     Dates::Date today(11,Dates::APR,Year(2018));
  743.     Library.setDate(today);
  744.  
  745.     Library.readFile(readBooks,readPatrons,readTransactions);
  746.  
  747.     cout << "*****WELCOME TO THE LIBRARY SYSTEM*****" << endl;
  748.     cout << "enter username" << endl;
  749.     getline(cin,userEntered);
  750.     cout << "enter password" << endl;
  751.     getline(cin,passEntered);
  752.  
  753.     while(true)
  754.     {
  755.         if(userEntered == userName && passEntered == password)
  756.         {
  757.             cout << "press (1) to print books by name" << endl;
  758.             cout << "press (2) to print books by ISBN" << endl;
  759.             cout << "press (3) to print view all books" << endl;
  760.             cout << "press (4) to reserve book for patron" << endl;
  761.             cout << "press (5) to add patron" << endl;
  762.             cout << "press (6) to view all patrons" << endl;
  763.             cout << "press (7) to add a book to Library" << endl;
  764.             cout << "press (8) to view transactions" << endl;
  765.             cout << "press (9) to quit" << endl;
  766.             cout << "press (10) to print today's date" << endl;
  767.             cout << "press (11) to clear screen(clean up)" << endl;
  768.  
  769.             int choice;
  770.             cin >> choice;
  771.             cin.get();
  772.  
  773.             switch(choice)
  774.             {
  775.  
  776.             case 1:
  777.             {
  778.                 string name;
  779.                 cout << "Enter name of book" << endl;
  780.                 getline(cin,name);
  781.                 Library.searchByName(name);
  782.             }
  783.             break;
  784.             case 2:
  785.             {
  786.                 string ISBN;
  787.                 cout << "enter author" << endl;
  788.                 getline(cin,ISBN);
  789.                 Library.searchByISBN(ISBN);
  790.             }
  791.             break;
  792.             case 3:
  793.                 Library.printBooks();
  794.                 break;
  795.             case 4:
  796.             {
  797.                 cout << "**Reserve a book** " << endl;
  798.                 cout << "please enter the card number of the patron" << endl;
  799.                 string cn;
  800.                 getline(cin,cn);
  801.                 for(int i = 0; i < Library.patrons.size(); i++)
  802.                 {
  803.                     if(cn == Library.patrons.at(i).getCardNumber())
  804.                     {
  805.                         cout << "please enter the ISBN of the book you want to reserve for patron " << endl;
  806.                         string ISBN;
  807.                         getline(cin,ISBN);
  808.  
  809.                         for(int i = 0; i < Library.books.size(); i++)
  810.                         {
  811.                             if(ISBN == Library.books.at(i).getISBN())
  812.                             {
  813.                                 if(Library.books.at(i).checkOutBook())
  814.                                 {
  815.  
  816.                                     Library.addTransaction(storeTransactions,ISBN,cn);
  817.                                 }
  818.                             }
  819.                         }
  820.                     }
  821.                 }
  822.             }
  823.             break;
  824.             case 5:
  825.                 Library.addPatron(storePatrons);
  826.                 break;
  827.             case 6:
  828.                 Library.printPatrons();
  829.                 break;
  830.             case 7:
  831.                 Library.addBook(storeBooks);
  832.                 break;
  833.             case 8:
  834.                 for(int i = 0; i < Library.transactions.size(); i++)
  835.                 {
  836.  
  837.                     cout << " Patron card number : "  << Library.transactions.at(i).patron.getCardNumber()
  838.                          << " Book ISBN : " << Library.transactions.at(i).book.getISBN() <<
  839.                          "date checked out : " << Library.transactions.at(i).dateTaken.getDay() <<
  840.                          "/" << Library.transactions.at(i).dateTaken.getMonth() <<
  841.                          "/" << Library.transactions.at(i).dateTaken.getYear().y <<
  842.                          " date due back : " << Library.transactions.at(i).dateDue.getDay() <<
  843.                          "/" << Library.transactions.at(i).dateDue.getMonth() <<
  844.                          "/" << Library.transactions.at(i).dateDue.getYear().y << endl;
  845.  
  846.                     // NEXT DAY IMPLEMENT A WAY TO CHECK IF FEE HAS BEEN PAID
  847.                     // DELETE TRANSACTION FROM DATABASE FILE IF IT HAS
  848.  
  849.                     // ALSO CHECK ALL TRANSACTIONS TO SEE IF DATE IS DUE BACK AND IF IT IS PAST THAT
  850.                     // ADD FINES TO PATRONS ACCOUNT
  851.                 }
  852.                 break;
  853.             case 9:
  854.                 return true;
  855.             case 10:
  856.                 Library.printDate();
  857.                 break;
  858.             case 11:
  859.                 system("cls");
  860.             }
  861.         }
  862.         else
  863.         {
  864.             return false;
  865.         }
  866.     }
  867.     return true;
  868. }
  869.  
  870. int main()
  871. {
  872.     driver();
  873. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement