Thread: Database / Tex

  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    46

    Database / Tex

    I'm sure some of this program will be in C++ so...

    I'd like to write a program that automatically produces tex files for high school math test. This involves having a database of questions and answers. Each question and answer will be a block of text. The database may have thousands of questions to chose from.

    How should I store the database of questions so that I don't have to load them all into a giant array of questions and answers? If I want to use questions 5, 11 and 99 the program should just go and get those questions from the database file. Is this a job for something like SQL? (I've never used database software other than goofing around with MS Works and Office)

    Thanks,
    Peter

  2. #2
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,164
    Store all the questions in one line in the file.
    To get the desired questions,
    1) read each one,
    1a) if it's one you want to keep save it
    2) repeat until you have all the questions you need.

    Using a database and SQL can be difficult, but that can work as well. For the simplicity of your task, a text dile would work fine.
    Definition: Politics -- Latin, from
    poly meaning many and
    tics meaning blood sucking parasites
    -- Tom Smothers

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. literature database: help with planning
    By officedog in forum C++ Programming
    Replies: 1
    Last Post: 01-23-2009, 12:34 PM
  2. Creating a database
    By Shamino in forum Game Programming
    Replies: 19
    Last Post: 06-10-2007, 01:09 PM
  3. Replies: 10
    Last Post: 05-18-2006, 11:23 PM
  4. Developing database management software
    By jdm in forum C++ Programming
    Replies: 4
    Last Post: 06-15-2004, 04:06 PM
  5. Making a Simple Database System
    By Speedy5 in forum C++ Programming
    Replies: 1
    Last Post: 03-14-2003, 10:17 PM