CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2016
    Posts
    3

    Adding/Searching/Editing Arrays - Serendipity Booksellers Project

    Hello everyone. I was wondering if there was anyone that could help me with this code. Under the invtmenu.cpp file, I need to be able to add a book, look up a book, edit a book, and delete a book. (void addbook(), void editbook(), etc.. all of which can be placed inside the invtmenu.cpp file) I know a little bit of how I am to set it up, but I can not get anything to work. I know this is not the most challenging thing in the world, but this is the only concept I have had trouble understanding. If anyone could help out just by getting me started, I would deeply appreciate it.



    Code:
    #include "cashier.hpp"
    #include "invtmenu.hpp"
    #include "bookinformation.hpp"//3. include header file
    #include "reports.hpp"
    #include <iostream>
    #include <string>
    #include <iomanip>
    
    using namespace std;
    
    const int SIZE = 10;//1. declared before main function
    string isbn[SIZE];// = {""}; 2. passing parameters
    string title[SIZE];// = {""};
    string author[SIZE];// = {""};
    string publisher[SIZE];// = {""};
    string dateAdded[SIZE];// = {""};
    int qty[SIZE];// = {0};
    double wholeCost[SIZE];// = {0.0};
    double retail[SIZE];// = {0.0};
    
    
    int main ()
    {
    int menu_choice;
    
    do
    {
    cout << "\n\t\t\t\t\t\t\t\t " << " Serendipity Booksellers \n ";
    cout << "\t\t\t\t\t\t\t\t\t" << " Main Menu \n\n";
    cout << "\t\t\t\t\t\t\t\t " << "1." << " Cashier Module \n";
    cout << "\t\t\t\t\t\t\t\t " << "2." << " Inventory Database Module \n";
    cout << "\t\t\t\t\t\t\t\t " << "3." << " Report Module \n";
    cout << "\t\t\t\t\t\t\t\t " << "4." << " Exit \n\n";
    cout << "\t\t\t\t\t\t\t\t " << "Enter your choice: ";
    cin >> menu_choice;
    cout << "\n\n\n";
    
    
    
    switch (menu_choice)
    {
    case 1:
    
    cout << "\t\t\t\t\t\t\t\t " << "You have selected 1. Cashier Module. \n";
    cashier();
    break;
    case 2:
    
    cout << "\t\t\t\t\t\t\t\t " << "You have selected 2. Inventory Database Module. \n";
    invtmenu();
    break;
    case 3:
    cout << "\t\t\t\t\t\t\t\t " << "You have selected 3. Report Module \n";
    reports();
    break;
    case 4:
    cout << "\t\t\t\t\t\t\t\t " << "You have selected 4. Exit \n";
    break;
    
    default:
    cout << "\t\t\t\t\t\t\t\t " << "Please enter a number 1 - 4.\n";
    
    
    }
    cout << endl;
    } while (menu_choice != 4);// fixed bug with putting in default, entry 4 = exit, and switch is inside loop
    cout << "\n\n";
    
    return 0;
    }
    
    
    //reports.cpp
    
    //
    // reports.cpp
    // SBS_Part_6
    //
    // Created by Eric on 3/30/16.
    // Copyright  2016 Eric. All rights reserved.
    //
    
    
    #include <iostream>
    
    using namespace std;
    
    void reports()
    {
    int choice;
    
    do
    {
    cout << "\n\t\t\t\t\t\t\t" << " Serendipity Booksellers \n ";
    cout << "\t\t\t\t\t\t\t\t" << " Reports \n\n";
    cout << "\t\t\t\t\t\t\t " << "1." << " Inventory Listing \n";
    cout << "\t\t\t\t\t\t\t " << "2." << " Inventory Wholesale Value \n";
    cout << "\t\t\t\t\t\t\t " << "3." << " Inventory Retail Value \n";
    cout << "\t\t\t\t\t\t\t " << "4." << " Listing by Quantity \n";
    cout << "\t\t\t\t\t\t\t " << "5." << " Listing by Cost \n";
    cout << "\t\t\t\t\t\t\t " << "6." << " Listing by Age \n";
    cout << "\t\t\t\t\t\t\t " << "7." << " Return to Main Menu \n\n";
    cout << "\t\t\t\t\t\t\t " << "Enter Your Choice: ";
    cin >> choice;
    
    
    
    while ( choice < 1 || choice > 7)
    {
    cout << "\t\t\t\t\t\t\t\t" << "Please Enter A Number 1-7" << endl << endl;
    cin >> choice;
    }
    switch (choice)
    {
    case 1:
    
    cout << "\t\t\t\t\t\t\t " << "You have selected 1." << " Inventory Listing \n";
    break;
    
    case 2:
    
    cout << "\t\t\t\t\t\t\t " << "You have selected 2." << " Inventory Wholesale Value \n";
    break;
    
    case 3:
    
    cout << "\t\t\t\t\t\t\t " << "You have selected 3." << " Inventory Retail Value \n";
    break;
    
    case 4:
    
    cout << "\t\t\t\t\t\t\t " << "You have selected 4." << " Listing by Quantity \n";
    break;
    
    case 5:
    
    cout << "\t\t\t\t\t\t\t " << "You have selected 5." << " Listing by Cost \n";
    break;
    
    case 6:
    
    cout << "\t\t\t\t\t\t\t " << "You have selected 6." << " Listing by Age \n";
    break;
    
    case 7:
    
    cout << "\t\t\t\t\t\t\t " << "Returning to main menu\n";
    break;
    default:
    cout << "\t\t\t\t\t\t\t " << "Please enter a number 1 - 7.\n";
    }
    }while ( choice !=7);
    }
    
    
    
    //cashier.cpp
    
    
    #include<iostream>
    #include<iomanip>
    #include<cstring>
    using namespace std;
    
    void cashier()
    {
    
    int qty;
    float price;
    double subtotal, tax, total;
    char date[10], isbn[20], title[40], again;
    
    
    cout << "\t\t\t\t\t\t\t Serendipity Booksellers" << endl;
    cout << " \t\t\t\t\t\t\t Cashier Module" << endl << endl;
    for(int count = 0; count < 20; count++)
    {
    cout << "\t\t\t\t\t\t\t Date: ";
    cin >> date;
    cout << "\t\t\t\t\t\t\t Quantity of Book: ";
    cin >> qty;
    cout << "\t\t\t\t\t\t\t ISBN: ";
    cin >> isbn;
    cin.ignore();
    cout << "\t\t\t\t\t\t\t Title: ";
    cin.getline (title, 40);
    cout << "\t\t\t\t\t\t\t Price: ";
    cin >> price;
    cout << endl << endl;
    
    subtotal = price * qty;
    tax = subtotal * .06;
    total = subtotal + tax;
    
    
    
    
    cout << "\t\t\t\t\t\t\t Serendipity Booksellers" << endl << endl;
    cout << "Date: " << date << endl << endl;
    cout << "Qty" << setw(7) << "ISBN" << setw(16) << "Title" << setw(22) << "Price" << setw(14) << "Total" << endl;
    cout << "________________________________________________________________________" << endl;
    cout << qty << " ";
    cout << setw(15) << left << isbn;
    cout << setw(22) << left << title;
    cout << setprecision(2) << fixed << showpoint << "$" << price;
    cout << setprecision(2) << fixed << showpoint << " $" << left << total;
    cout << endl <<endl <<endl;
    cout << setprecision(2) << showpoint << fixed << " Subtotal $" << subtotal << endl;
    cout << setprecision(2) << showpoint << fixed << " Tax $" << tax << endl;
    cout << setprecision(2) << showpoint << fixed << " Total $" << total << endl << endl;
    
    
    
    cout << endl << "Would you like to do another (y/n)" << endl;
    cin >> again;
    cout << endl;
    if (again == 'N' || again == 'n') {
    break;
    }
    
    cout << endl;
    }
    
    }
    
    //invtmenu.cpp
    
    #include <iostream>
    #include "bookinformation.hpp"
    #include <string>
    #include <cstring>
    using namespace std;
    
    const int SIZE = 10;
    extern string title[SIZE];
    extern string isbn[SIZE];
    extern string author[SIZE];
    extern string publisher[SIZE];
    extern string dateAdded[SIZE];
    extern int qty[SIZE];
    extern double wholeCost[SIZE];
    extern double retail[SIZE];
    //void addbook();
    void invtmenu()
    {
    int choice;
    do
    {
    cout << "\n\t\t\t\t\t\t\t\t" << "Serendipity Booksellers \n ";
    cout << "\t\t\t\t\t\t\t\t" << " Inventory Database \n\n";
    cout << "\t\t\t\t\t\t\t\t" << "1." << " Look Up a Book \n";
    cout << "\t\t\t\t\t\t\t\t" << "2." << " Add a Book \n";
    cout << "\t\t\t\t\t\t\t\t" << "3." << " Edit a Book's Record \n";
    cout << "\t\t\t\t\t\t\t\t" << "4." << " Delete a Book \n";
    cout << "\t\t\t\t\t\t\t\t" << "5." << " Return to Main Menu\n\n ";
    cout << "\t\t\t\t\t\t\t\t" << "Enter Your Choice: ";
    cin >> choice;
    
    while ( choice < 1 || choice > 5 )
    {
    cout << "\t\t\t\t\t\t\t\t\t" << " Enter a number 1-5";
    cin >> choice;
    }
    switch (choice)
    {
    case 1:
    cout << "\t\t\t\t\t\t\t\t\t" << " You have selected Look up a book\n";
    //void lookupbook();
    break;
    
    case 2:
    cout << "\t\t\t\t\t\t\t\t\t" << " You have selected Add a book\n";
    void addbook();
    break;
    
    case 3:
    cout << "\t\t\t\t\t\t\t\t\t" << " You have selected Edit a book's record\n";
    break;
    
    case 4:
    cout << "\t\t\t\t\t\t\t\t\t" << " You have selected Delete a book\n";
    break;
    
    case 5:
    cout << "\t\t\t\t\t\t\t\t\t" << " You will be returned to the main menu\n";
    break;
    default:
    cout << "\t\t\t\t\t\t\t\t\t" << "Enter a number 1 - 5\n";//bug fix, enter default
    }
    } while ( choice != 5);
    
    
    
    
    //return 0;
    
    }
    
    
    
    
    //bookinformation.cpp
    
    //i was just putting some extra stuff in as notes, i assumed it's going to look close to this eventually anyway.
    //i just followed your instructions from the hints on angel
    
    #include <iostream>
    #include "bookinformation.hpp" //3. include header file. 
    
    using namespace std;
    
    void bookinformation (string isbn, string title, string author, string publisher, string dateAdded, int qty, double wholeCost, double retail)// 1. change the name. 2. pass the parameters.
    {
    //for (int i = 0; i < 20; i++)
    //{
    
    cout << "\n\t\t\t\t\t\t\t" << " Serendipity Booksellers \n ";
    cout << "\t\t\t\t\t\t\t\t" << " Book Info \n\n";
    cout << "\tISBN: \n";// << isbn[i] << endl;
    cout << "\tTitle: \n"; //<< title[i] << endl;
    cout << "\tAuthor: \n";// << author[i] << endl;
    cout << "\tPublisher: \n"; // << publisher[i] << endl;
    cout << "\tDate Added: \n"; //<< dateAdded[i] << endl;
    cout << "\tQuantity-On-Hand: \n"; //<< qty[i] << endl;
    cout << "\tWholesale Cost: \n"; //<< wholeCost[i] << endl;
    cout << "\tRetail Price: \n"; //<< "\n" << retail[i] << endl;
    
    //}
    
    
    
    }

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,552

    Re: Adding/Searching/Editing Arrays - Serendipity Booksellers Project

    Is this a homework assignment?

    but I can not get anything to work.
    This is not really a helpful statement. Does the code compile? If no, what are the errors shown? If yes, then surely the main menu is displayed? In what circumstances does what not work? What debugging of the program using the debugger has been done?
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++20 Compiler: Microsoft VS2019 (16.11.5)

  3. #3
    Join Date
    Apr 2016
    Posts
    3

    Re: Adding/Searching/Editing Arrays - Serendipity Booksellers Project

    Quote Originally Posted by 2kaud View Post
    Is this a homework assignment?



    This is not really a helpful statement. Does the code compile? If no, what are the errors shown? If yes, then surely the main menu is displayed? In what circumstances does what not work? What debugging of the program using the debugger has been done?

    This is not a homework assignment, I don't even go to school haha. I just wanted to start learning c++ so i bought the cheapest book I could off of a friend of mine and this is the project in it. Right now I am having problems with looking up a book. Everything compiles correctly with the exception of my void lookupbook(). Here is an updated code of my invtmenu.cpp file

    Code:
    #include <iostream>
    #include "bookinformation.hpp"
    #include <string>
    #include <cstring>
    using namespace std;
    
    const int SIZE = 10;
    extern string title[SIZE];
    extern string isbn[SIZE];
    extern string author[SIZE];
    extern string publisher[SIZE];
    extern string dateAdded[SIZE];
    extern int qty[SIZE];
    extern double wholeCost[SIZE];
    extern double retail[SIZE];
    
    
    
    void addbook();
    void invtmenu()
    {
        int choice;
        do
        {
            cout << "\n\t\t\t\t\t\t\t\t" << "Serendipity Booksellers \n ";
            cout << "\t\t\t\t\t\t\t\t" << "  Inventory Database \n\n";
            cout << "\t\t\t\t\t\t\t\t" << "1." << " Look Up a Book \n";
            cout << "\t\t\t\t\t\t\t\t" << "2." << " Add a Book \n";
            cout << "\t\t\t\t\t\t\t\t" << "3." << " Edit a Book's Record \n";
            cout << "\t\t\t\t\t\t\t\t" << "4." << " Delete a Book \n";
            cout << "\t\t\t\t\t\t\t\t" << "5." << " Return to Main Menu\n\n ";
            cout << "\t\t\t\t\t\t\t\t" << "Enter Your Choice: ";
            cin >> choice;
            
            while ( choice < 1 || choice > 5 )
            {
                cout << "\t\t\t\t\t\t\t\t\t" << " Enter a number 1-5";
                cin >> choice;
            }
            switch (choice)
            {
                case 1:
                    cout <<  "\t\t\t\t\t\t\t\t\t" << " You have selected Look up a book\n";
                    //lookupbook();
                    break;
                    
                case 2:
                    cout <<  "\t\t\t\t\t\t\t\t\t" << " You have selected Add a book\n";
                    addbook();
                    break;
                    
                case 3:
                    cout <<  "\t\t\t\t\t\t\t\t\t" << " You have selected Edit a book's record\n";
                    break;
                    
                case 4:
                    cout <<  "\t\t\t\t\t\t\t\t\t" << " You have selected Delete a book\n";
                    break;
                    
                case 5:
                    cout <<  "\t\t\t\t\t\t\t\t\t" << " You will be returned to the main menu\n";
                    break;
                default:
                    cout << "\t\t\t\t\t\t\t\t\t" << "Enter a number 1 - 5\n";//bug fix, enter default
            }
        } while ( choice != 5);
        
        
        
        
        //return 0;
        
    }
    
    void addbook()
    {
        int found = 0;
        int index = 0;
        
        cout << "You have selected Add a Book\n";
        
        while (found == 0 && index < SIZE)
        {
            
            if (title[index] == "" )
                found = 1 ;
            else
                index++;
        }
        
        cout << endl << endl;
        
       
        
        if (index > -1)
        {
        cout << "Enter book information\n";
            
            cin.ignore();
        cout << "Enter title:\n";
        getline(cin, title[index]);
            //cin.ignore();
        
        cout << "Enter isbn:\n";
        getline(cin, isbn[index]);
            //cin.ignore();
        
        cout << "Enter author:\n";
        getline(cin, author[index]);
            //cin.ignore();
        
        cout << "Enter publisher:\n";
        getline(cin, publisher[index]);
            //cin.ignore();
        
        cout << "Enter date added:\n";
        getline(cin, dateAdded[index]);
            //cin.ignore();
    
        
        cout << "Enter quantity:\n";
            //cin.ignore();
            cin >> qty[index];
        //cin.ignore();
        
        cout << "Enter wholesale price:\n";
            //cin.ignore();
        cin >> wholeCost[index];
        //cin.ignore();
        
        cout << "Enter retail price:\n";
            //cin.ignore();
        cin >> retail[index];
        //cin.ignore();
        }
        
        else
        {
            
            cout << "No space to add book now.\n";
            return;
            
        }
        
    
        cout << endl;
        
    }
    
    
    
    
    
    void lookupbook()
    {
        string searchtitle;
        //int searchfound = 0;
        //int searchindex = 0;
        int found = 0;
        int index = 0;
        
        cout << "Enter title to search for:\n";
        cin.ignore();
        getline(cin, searchtitle);
        while (found == 0 && index < SIZE)
        {
            if(title[index] == searchtitle)
            {
                found = true;
            }
            else
                index++;
            
        }
        
        if (found)
        {
            //display book information
        }
        else
            cout << "Book is not in inventory\n";
    }
    
    
    
    
    
    
    void editbook()
    {
        
    }
    
    
    
    
    
    void deletebook()
    {
        
    }
    I think it needs to be linked to this, but I'm not really sure. And if it does, I don't really know how either.
    Code:
    #include <iostream>
    #include "bookinformation.hpp" //3. include header file.
    #include "invtmenu.hpp"
    
    using namespace std;
    
    void bookinformation (string isbn, string title, string author, string publisher, string dateAdded, int qty, double wholeCost, double retail)// 1. change the name. 2. pass the parameters.
    {
        //for (int i = 0; i < 20; i++)
        //{
        
        cout << "\n\t\t\t\t\t\t\t" << " Serendipity Booksellers \n ";
        cout << "\t\t\t\t\t\t\t\t" << "  Book Info \n\n";
        cout << "\tISBN: \n";// << isbn[i] << endl;
        cout << "\tTitle: \n";// << title[i] << endl;
        cout << "\tAuthor: \n";// << author[i] << endl;
        cout << "\tPublisher: \n";//  << publisher[i] << endl;
        cout << "\tDate Added: \n";//  << dateAdded[i] << endl;
        cout << "\tQuantity-On-Hand: \n";// << qty[i] << endl;
        cout << "\tWholesale Cost: \n";// << wholeCost[i] << endl;
        cout << "\tRetail Price: \n";//   << "\n" << retail[i] << endl;
            
        //}
        
        
        
    }

  4. #4
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,552

    Re: Adding/Searching/Editing Arrays - Serendipity Booksellers Project

    Everything compiles correctly with the exception of my void lookupbook()
    and what is the compiler error message and for which line?
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++20 Compiler: Microsoft VS2019 (16.11.5)

  5. #5
    Join Date
    Apr 2016
    Posts
    3

    Re: Adding/Searching/Editing Arrays - Serendipity Booksellers Project

    Quote Originally Posted by 2kaud View Post
    and what is the compiler error message and for which line?

    so, i got the code to work.. the only problem i'm having is that when i search for the array.. it repeats 20 times. with the first one being correct, then none of the rest being correct. i believe it's a loop error, but i have no idea how to fix it. nothing in this book seems to work.

    Code:
    void lookupbook()
    {
    
        int found = 0;
        int index = 0;
        cin.ignore();
        cout << "Enter title to search for:\n";
        getline(cin, searchtitle);
        while (found == 0 && index < SIZE)
        {
            if(title[index] == searchtitle)
            
                found = true;
                //bookinformation (title, isbn, author, publisher, dateAdded, qty, wholeCost, retail);
                //break;
            
            else
                index++;
            
        }
        
        if (found > -1)
        {
            
           //display book information
            //cout << "Book found\n";
           bookinformation (title, isbn, author, publisher, dateAdded, qty, wholeCost, retail);
            //cout << endl;
           
        }
        else
            cout << "Book is not in inventory\n";
    }

  6. #6
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,607

    Re: Adding/Searching/Editing Arrays - Serendipity Booksellers Project

    Code:
        while (found == 0 && index < SIZE)
        {
            if(title[index] == searchtitle)
            
                found = true;
                //bookinformation (title, isbn, author, publisher, dateAdded, qty, wholeCost, retail);
                //break;
            
            else
                index++;
            
        }
    This is to look more clear:
    Code:
        bool found = false;
        for (index = 0; index < SIZE; index++)
        {
            if(title[index] == searchtitle)
            {
                found = true;
                break;
            }
        }
    And try to use debugger to see what your programs really do.
    Last edited by Igor Vartanov; April 29th, 2016 at 01:51 AM.
    Best regards,
    Igor

  7. #7
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,552

    Re: Adding/Searching/Editing Arrays - Serendipity Booksellers Project

    i bought the cheapest book I could off of a friend of mine and this is the project in it.
    Which book is this? Any book written before about 2012 won't cover the major changes to c++ that were introduced with c++11. The current version of c++ is c++14 - so ideally you want a book written no earlier than 2015.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++20 Compiler: Microsoft VS2019 (16.11.5)

  8. #8
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,552

    Re: Adding/Searching/Editing Arrays - Serendipity Booksellers Project

    Code:
    if (found > -1)
    This is not how you test. false has the value 0 and true has a value which is not 0 (but is often 1 as with MS VS). So in this case both true and false are greater than -1 so even if the book is not found it will try to display the book details!

    When you require a boolean value (eg for something found or not found) then you should use the bool type as in Ignor's post #6.

    Code:
    bookinformation (title, isbn, author, publisher, dateAdded, qty, wholeCost, retail);
    Once a book has been found, you try to display its info. The parameters to bookinformation() relate to a specific book but you are passing the string array title etc to the function bookinformation() which expects just a type string. Also you have title and isbn reversed.

    In bookinformation() you are passing in parameters for title, isbn, author etc and then trying to index them via variable i as if they were arrays - and i isn't used in the function?

    I don't know how far you are in the c++ book you are using, but rather than using separate variables/arrays for title, isbn, author etc - a better way would be to use a struct (or a class if you have come to them yet). You could then have a data structure like
    Code:
    struct BookInfo
    {
        string title;
        string isbn;
        string author;
        string publisher;
    ....
    };
    
    const size_t SIZE = 10;
    
    BookInfo books[SIZE];
    So rather than passing all those parameters to bookinformation(), you pass just one of type BookInfo.

    The search code could then be (not tried)
    Code:
    bool found = false;
    for (size_t ind = 0; !found && (ind < SIZE); ++ind)
        if (books[ind].title == searchtitle) {
            found = true;
            bookinformation(books[ind]);
        }
    
    if (!found)
        cout << "Book is not in inventory" << endl;
    and similar changes to the other code.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++20 Compiler: Microsoft VS2019 (16.11.5)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured