Thread: Newbie

  1. #1
    Registered User
    Join Date
    May 2003

    Question Newbie

    Could someone point me in the right direction as to how I write this program. I have only been writing for a couple of weeks.
    I need to write a program that will determine if a person has exceeded the credit limit on a charge account. The facts I am using are: Account Number (an integer)
    Balance at the beginning of the month
    Total of items charge by customer for that month
    Total of all credits apply to account for the month
    Allowed credit limit

    The program should imput each of these,calculate the new balance and determine if the new balance is over the credit limit. I also need it to print a message stating the "credit limit is exceeded". Any help would be appreciated.

  2. #2
    Registered User
    Join Date
    Feb 2003
    I'm assuming there's some kinda database with the CC #'s or something? well....basically, just have if statements....

    if (amountspent > credlimit)
    cout << "They went over the limit\n";

  3. #3
    Wen Resu
    Join Date
    May 2003
    your gona need some kind fo database. Be it a text file, binary file or the like, or a datbase like Microsoft Access MySQL etc etc.

  4. #4
    Hardware Engineer
    Join Date
    Sep 2001

    You might not need a database.

    For the simplest case (an exercise for someone programming a couple of weeks) you don't need a database.

    1- Create variables for the various amounts.
    2- Have the user enter the amounts for each variable.
    3- Do the math.
    4- Make the decision
    5- Display the result
    (In this case, you don't really need the account number.)

    A more advanced version might use a structure (AccountNumber.TotalCharged, etc)

    Even more advanced - Use classes and objects (Each Account is an object.)

    HINT - Next time, use a more descriptive title for your post.

  5. #5
    Registered User
    Join Date
    May 2003


    Thank for all your help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. getting to grips with allegro and ms vc++ (newbie)
    By jimjamjahaa in forum C++ Programming
    Replies: 4
    Last Post: 11-18-2005, 07:49 PM
  2. Newbie in problem with looping
    By nrain in forum C Programming
    Replies: 6
    Last Post: 11-05-2005, 12:53 PM
  3. Newbie Programmer
    By Extropian in forum C++ Programming
    Replies: 3
    Last Post: 05-18-2004, 01:17 PM
  4. Some help for a newbie?
    By Ilmater in forum C++ Programming
    Replies: 23
    Last Post: 04-19-2004, 07:44 PM
  5. Newbie Game Develpoers Unite!
    By Telenosis in forum Game Programming
    Replies: 10
    Last Post: 06-22-2002, 02:02 PM