Thread: Difficult programming problem

  1. #1
    Registered User
    Join Date
    Feb 2002

    Question Difficult programming problem

    I have a problem in understanding a program I am working on so I thought I would see if I could get some help from others. Here is the situation:

    The program is designed to to read credit card records and print payoff schedules for the customers. The input records contain an account number, customer name and balance due. For each of the customer i am required to print the account number, and name and then print the customers payment amount and new balance each month until the card is paid off. I am to assume that when a balance reaches $10 or less the customer can pay off the balance. At the beginning of every month 1.5% interest is added to the balance, then the customeer makes 5% payment of the current balance. Assume the customer makes no new purchases.

    I am confused about the logoc and design of the program so any source code or input woul be greatly appreciated.

  2. #2
    declare iftsream and open it associated with file to be read.

    declare variables to hold customers information as per specification sheet.

    read in data for a given customer

    do math on customers account until balance is under $10 and then assume final payment of full amount. Use parrameters supplied in specifications.

    Display data in neat format. All data for a given customer to be calculated and displayed before moving on to next customer.

    repeat process for all customers (until end of file has been reached).

    math is:
    while owed > 10.00
    owed = (owed * 0.015) - (owed * 0.05);

  3. #3
    alternate math could be

    while owed > 10.00

    owed *= 0.015;//add interest before deducting payment
    owed *= 0.95;//amount owed after payment

    or if you want to keep track of interest payed and total payments

    while owed > 10.00
    interest = owed * 0.015
    total interest to date += interest;
    owed += interest;
    payment = owed * 0.05;
    total payments to date += payment;
    owed *= 0.95;

  4. #4
    Registered User
    Join Date
    Feb 2002
    you could use a structure to organise the user information i.e:

    struct sAccountData
    long int AccountNo;
    char CustName[40];
    float Balance;

    then using file i/o you would get the user to input all the cutomers details which would be saved to a text file for use later.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  2. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  3. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  4. Replies: 5
    Last Post: 11-07-2005, 11:34 PM
  5. A difficult Problem.
    By Kam in forum C Programming
    Replies: 4
    Last Post: 11-13-2002, 05:06 AM