Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Need help on writing a library book keeping software

Need help on writing a library book keeping software

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++databasehelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 1795037
    wrote on last edited by
    #1

    Dear gurus, I am required to write a C++ library program using Visual C++ 6.0. The criterias are: 1)Create 2 output .dat files one for the library book database and the other for borrowers list and books that are leased. The first file will list: Book Title Date added Author Publisher Avilbility status The second file will list: Name of borrower Book borrowed Date borrowed Expiry Date 2)The menu of the program should have: a)Review books database and availability b)Review/List borrowers/books borrowed c)Add/alter books list d)Add/Remove borrowers from the list Need help ASAP.Only had 2 months experience with C++.Currently I only know how to create classes,make switch statements,arrays,structures and loops.Still not very familiar with I/O writing/reading.I am having headache on how to relate all of them.Another question is how do I individually remove the data from the database one by one specifically?I know how to write a list and add but let's say member #3 already returns his book how to remove him from the list and change the book availability status in the other file to available again? Thanks in advanced.

    Z 1 Reply Last reply
    0
    • U User 1795037

      Dear gurus, I am required to write a C++ library program using Visual C++ 6.0. The criterias are: 1)Create 2 output .dat files one for the library book database and the other for borrowers list and books that are leased. The first file will list: Book Title Date added Author Publisher Avilbility status The second file will list: Name of borrower Book borrowed Date borrowed Expiry Date 2)The menu of the program should have: a)Review books database and availability b)Review/List borrowers/books borrowed c)Add/alter books list d)Add/Remove borrowers from the list Need help ASAP.Only had 2 months experience with C++.Currently I only know how to create classes,make switch statements,arrays,structures and loops.Still not very familiar with I/O writing/reading.I am having headache on how to relate all of them.Another question is how do I individually remove the data from the database one by one specifically?I know how to write a list and add but let's say member #3 already returns his book how to remove him from the list and change the book availability status in the other file to available again? Thanks in advanced.

      Z Offline
      Z Offline
      Zero_divide_1
      wrote on last edited by
      #2

      As most of us here only help with understanding and small tidbits of code, you probably won't find your completed project, but here is a couple of pointers (no pun intended :-D): Adding items is easy: just append each item at the end of the list, then save just the appended data to the file. However, when you remove the items, depending on where it is in the file, you will have to remove the item and shift everything after it back 1 spot. Since you don't have a lot of programming experience, I suggest this: load the list into memory and do all the processing there. Each add will add to the list to memory, and append the item to the file. Each remove, however, will remove the item from memory and rewrite the file from scratch. I know this process is can be slow when there are a lot of items, but its a surefire way to make it work. The other alternative is figure out some way to use ODBC or some other SQL server, which have much more efficient ways of inserting and removing items from databases. Hope this helps you out a little. Happy coding!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups