Sunday, August 2, 2009

I'm clueless with this c program! someone please help me...?

Develop a C program that will determine if a department store customer has exceeded the credit limit on a charge account. For each customer, the following facts are available:


a. Account number


b. Balance at the beggining of the month


c. Total of all items charged by this customer this month


d. Total of all credits applied to this customer's account this month


e. Allowed credit limit


The program should input each of these facts, calculate the new balance (=beginning balance + charges - credits), and determine if the new balance exceeds the customer's credit limit. For those customers whose credit limit is exceeded, the program should display the customer's account number, credit limit, new balance and the message "Credit limit exceeded."








i can't seem to know were to start from or what to do





please help me...


spare my poor soul


thanks


thanks


thanks


thanks

I'm clueless with this c program! someone please help me...?
#include%26lt;iostream.h%26gt;





int main(void)


{


int acctNumber;


float creditLimit;


float startBalance;


float endBalance;


float monthCharges;


float monthCredits;





printf("Enter the following info:\n\n\n");


printf("Enter account number:\n");


scanf("%d",%26amp;acctNumber);


printf("Enter credit limit:\n");


scanf("%d",%26amp;creditLimit);


printf("enter begining balance:");


scanf("%d",%26amp;startBalance);


printf("enter monthly charges:");


scanf("%d",%26amp;monthCharges);


printf("enter monthly Credits:");


scanf("%d",%26amp;monthCredits);





endBalance = startBalance + (monthCharges - monthCredits);





printf("Account No. %d, credit limit is %d; current balance is %d\n", acctNumber, creditLimit, endBalance);





if(endBalance %26gt; creditLimit) {


printf("Credit limit exceeded.\n");


}





return 0;


}


No comments:

Post a Comment