Thanks for the Help, Sebastiani, I appreciate you taking the time to reply to my posting... I will take your advise going forward in Hopes of submitting future postings in a more meaningful manner.... You and your fellow programmers have much to share with future programmers like myself... Although I am new to all this I vow to NEVER submit a posting without putting several hours into compile & reserching my programs..... thnks
I am submitting my working program and open to any more suggestion.... thnks All
Code:
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
int _tmain(int argc, _TCHAR* argv[])
{
/* Determine if customer has Exceeded Credit Limit */
/* initialize variables */
int acctNum;
int cnter = 0;
float crdtBegBall = 0; /* Begenning Credit Ballance */
float totChrges = 0; /* Total Charges */
float totCrdtd = 0; /* Total Credit */
float crdtLmt = 0; /* Credit Limit */
float totCrdtBall = 0; /* crdtBegBall + totCrdtd */
/* processing phase - get input from User */
printf("\nEnter Account Number (1- to end): ");
scanf("%d", &acctNum); /* priming Read */
while (acctNum != -1)
{
if (acctNum != -1)
{
//printf("\nEnter Account Number (1- to end): ");
//scanf("%d", &acctNum); /* priming Read */
printf("\nEnter Beggenning Credit Ballance: ");
scanf("%f", &crdtBegBall);
printf("\nEnter Total Charges: ");
scanf("%f", &totChrges);
printf("\nEnter Total Credit: ");
scanf("%f", &totCrdtd);
printf("\nEnter Credit Limit: ");
scanf("%f", &crdtLmt);
totCrdtBall = crdtBegBall + totCrdtd;
printf("\n=======================================\n");
printf("\nThe Customer Account Number:\t %d\n", acctNum);
printf("\nThe Customer Credit Limit:\t %.2f\n", crdtLmt);
printf("\nThe Customer Credit Ballance:\t %.2f\n", totCrdtBall);
printf("\n=======================================\n");
if (totCrdtBall > crdtLmt)
{
printf("\nYou have Exceeded your Credit Limit\n");
printf("\n================================\n");
printf("\n===============================\n\n");
}
else
{
acctNum = -1;
}
}
printf("\nEnter Account Number (1- to end): ");
scanf("%d", &acctNum); /* priming Read */
}
return 0;
}