Thread: hi need help with credit limit program

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    3

    hi need help with credit limit program

    Develop a C++ program that will determine if a department store customer has exceeded the credit limit on a charge account. These info are available for each cutomrer…
    a. Account number(integer)
    b. Balance at the beginning by this customer this month
    c. Total of all items charged by the cust. This month
    d. Total of all credits applied to the cust account this month
    e. Allowed credit limit

    This program should input each of these facts, calculate the new balance(=beginning balance + charges –credits) and determine if the new balance exceeds the customers credits
    For those customers whose credit limit is exceeded, the program should display the customers account number, credit limit, new balance and the message “Credit limit exceeded”.

    The output should look like this….

    Enter account number (-1 to end):100
    Enter beginning balance: 5394.78
    Enter total charges: 1000.00
    Enter total credits: 500.00
    Enter credit limit: 5500.00
    Account: 100
    Credit limit: 5500.00
    Balance: 5894.78
    Credit Limit Exceeded.

    Enter account number (-1 to end): 200
    Enter beginning balance: 1000.00
    Enter total charges: 123.45
    Enter total credits: 321.00
    Enter credit limit: 1500.00

    Enter account number (-0 to end): 300
    Enter beginning balance: 500.00
    Enter total charges: 274.73
    Enter total credit limit: 800.00

    Enter account number (-1 to end): -1


    So far i have this
    Develop a C++ program that will determine if a department store customer has exceeded the credit limit on a charge account. These info are available for each cutomrer…
    a. Account number(integer)
    b. Balance at the beginning by this customer this month
    c. Total of all items charged by the cust. This month
    d. Total of all credits applied to the cust account this month
    e. Allowed credit limit

    This program should input each of these facts, calculate the new balance(=beginning balance + charges –credits) and determine if the new balance exceeds the customers credits
    For those customers whose credit limit is exceeded, the program should display the customers account number, credit limit, new balance and the message “Credit limit exceeded”.

    The output should look like this….

    Enter account number (-1 to end):100
    Enter beginning balance: 5394.78
    Enter total charges: 1000.00
    Enter total credits: 500.00
    Enter credit limit: 5500.00
    Account: 100
    Credit limit: 5500.00
    Balance: 5894.78
    Credit Limit Exceeded.

    Enter account number (-1 to end): 200
    Enter beginning balance: 1000.00
    Enter total charges: 123.45
    Enter total credits: 321.00
    Enter credit limit: 1500.00

    Enter account number (-0 to end): 300
    Enter beginning balance: 500.00
    Enter total charges: 274.73
    Enter total credit limit: 800.00

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Show us what code you have done so far, please.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    The Pantless Man CheesyMoo's Avatar
    Join Date
    Jan 2003
    Posts
    262
    And use code tags, and disable smilies.
    If you ever need a hug, just ask.

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    3

    heres the code so far

    // Fig. 2.9: fig02_09.cpp
    // Class average program with sentinel-controlled repetition.
    #include <iostream>

    using std::cout;
    using std::cin;
    using std::endl;
    using std::ios;

    #include <iomanip>

    using std::setprecision;
    using std::setiosflags;

    int main()
    {
    int total, // sum of grades
    gradeCounter, // number of grades entered
    grade, // one grade
    accountNum, // account number **
    TotChrgs, // total charges **
    TotCreds, // total credits**
    CredLim; // Credit limit (part) **
    double average; // number with decimal point for average

    // initialization phase
    total = 0;
    gradeCounter = 0;

    // processing phase
    cout << "Enter account number (-1 to end): ";
    cin >> accountNum;

    cout << "Enter Beginning Balance: ";
    cin >> grade;

    cout << "Enter total Charges: ";
    cin >> TotChrgs;

    cout << "Enter total credits: ";
    cin >> TotCreds;

    cout << "Enter Credit Limit: ";
    cin >> CredLim;oh


    something of this sort

  5. #5
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Please state a question. What are you having trouble with ? We won't just jump in and do your homework. You obviously miss a while loop at least. Try to put that one in first.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 11:17 PM
  2. Can someome help me with a program please?
    By WinterInChicago in forum C++ Programming
    Replies: 3
    Last Post: 09-21-2006, 10:58 PM
  3. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 07:51 AM
  4. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM