Search:

Type: Posts; User: jiggunjer

Page 1 of 8 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    548

    you mean you want an (abstract) base class?

    you mean you want an (abstract) base class?
  2. Thread: Need help~~

    by jiggunjer
    Replies
    2
    Views
    501

    Bah. I should have guessed from the crappy title.

    Bah. I should have guessed from the crappy title.
  3. Replies
    388
    Views
    28,369

    you have the answer when you do my unambiguous...

    you have the answer when you do my unambiguous exercise. In my example there are five 5's. So the answer is 5...
  4. Thread: Hangman

    by jiggunjer
    Replies
    3
    Views
    812

    Biggest sins at a glance: - premature...

    Biggest sins at a glance:
    - premature initialization
    - magic numbers (used[100], sizeof(words)/4)
    - using char* instead of strings
  5. Replies
    388
    Views
    28,369

    Given some array e.g. 1 5 6 5 2 5 3 5 4 5 how...

    Given some array e.g. 1 5 6 5 2 5 3 5 4 5 how would you count the amount of number 5 values?

    Given an integer, how do you print it? (hint: no friggin loop).
  6. Replies
    388
    Views
    28,369

    for (size_t i = 0; i < books.size(); i++) ...

    for (size_t i = 0; i < books.size(); i++)
    {
    books[i].set_check(false);
    }
    That code checks out every book in the library. How you get this wrong after...
  7. Replies
    388
    Views
    28,369

    I told you already it is bad to do checking in...

    I told you already it is bad to do checking in main. Class related checks should be done by the class in many cases. Btw you also did the check twice in the check_out.

    As for your first question,...
  8. Replies
    388
    Views
    28,369

    Since the last 10 pages didn't help I posted a...

    Since the last 10 pages didn't help I posted a code example and even pointed out how my code differs from your check_out. I am out of ideas to help you understand. Set_check modifies a book object. A...
  9. The last one is a function i.e. method that does...

    The last one is a function i.e. method that does not modify nembers of the class.
  10. Replies
    388
    Views
    28,369

    Like Jim said, you aren't. But if you can't tell...

    Like Jim said, you aren't. But if you can't tell the difference between my code and yours it means your basic code reading skill is too low. Notice I am modifying an object in a vector based on a...
  11. Replies
    388
    Views
    28,369

    //given a book object outbook to be checked out...

    //given a book object outbook to be checked out
    for (Book& buhk : books) {if (buhk==outbook) buhk.set_check(false);}
    //do you understand that the database has been updated now?

    You need to...
  12. Replies
    388
    Views
    28,369

    Based on what I saw when you last posted the...

    Based on what I saw when you last posted the check_out function, yes it is wrong (I said you were ignoring the database step mentioned in the use case). Unless I missed a revision. Aside from that...
  13. Replies
    388
    Views
    28,369

    It seems you're on the right track. Your should...

    It seems you're on the right track. Your should cout the value of number of books to help you debug. If e.g. you have 10 books in the library and 3 are checked out, the loop should print the values...
  14. Replies
    388
    Views
    28,369

    No, we already talked about that. As far as...

    No, we already talked about that. As far as checking in and out are concerned your library class is finished. It has all you need. Your logic is just failing because you don't realize you already...
  15. Replies
    388
    Views
    28,369

    Currently you ignore the updating database step....

    Currently you ignore the updating database step. What your check_out does is akin to the librarian taking a black marker and writing "checked out" on the book itself.

    Also lose the due date...
  16. Replies
    388
    Views
    28,369

    You are not getting it. Did you read the chapter...

    You are not getting it. Did you read the chapter on constructors? I didn't say anything about changing the initializer list, just change the constructor syntax, perhaps you don't know the difference,...
  17. Replies
    388
    Views
    28,369

    No, just leave it out, like you were told. You...

    No, just leave it out, like you were told. You don't need to mention all the members in a constructor. It makes sense to just call patron(name, UUID) in main. Under the hood you initialize the fee to...
  18. Replies
    388
    Views
    28,369

    Library contains so much crap. It should look...

    Library contains so much crap. It should look more like this.


    private:
    //transaction struct here
    vector<Book> books{};
    vector<Patron> patrons{};
    vector<Transaction>...
  19. Replies
    388
    Views
    28,369

    Jim posted the answer in 262 and you still do it...

    Jim posted the answer in 262 and you still do it wrong...

    The signature of a constructor (i.e. the parameters) need not be the same as, or even be related to the initialization list.
  20. Replies
    19
    Views
    4,417

    Sorry just checking: so the client can't declare...

    Sorry just checking: so the client can't declare the PIMPL class in their code if they want to use it anyway? Not saying they should, just wondering if it is possible.
  21. Replies
    388
    Views
    28,369

    Hmmm I think making library a friend of the isbn...

    Hmmm I think making library a friend of the isbn checker defeats the spec intention of separating it from library. I think a book and vector<book> parameter is ok. Though I would have made a simple...
  22. Replies
    6
    Views
    960

    Your update function makes a copy of the ship...

    Your update function makes a copy of the ship object, moves it, returns the copy. Since you don't store the return or overwrite the original object the object is trashed and nothing is truly updated....
  23. Replies
    388
    Views
    28,369

    You just said you're going to try using find()....

    You just said you're going to try using find(). As for the ISBN comparing, what syntax do you want the function to have? Should it take a vector? Variable arguments? Etc.
  24. Replies
    388
    Views
    28,369

    I'll give you a working example if you hit page...

    I'll give you a working example if you hit page 20 ;)
  25. Replies
    388
    Views
    28,369

    nothing happens to obj if you do...

    nothing happens to obj if you do v.push_back(obj).

    no I said you already done it the moment you call add_book(). That is registering it by making a copy and storing it in your vector. Your...
Results 1 to 25 of 184
Page 1 of 8 1 2 3 4