Sunday, December 27, 2009

Can you please help me about pascal programming?

Supppose you have a bank charge card with a balance of $5,000 and suppose the bank charge you a 2% per month interest. Please help me do a pascal program that will calculate the number of months it will take for the account balance to accumulate to $10,000. Please use while loop statement. Thanks! (:p)Can you please help me about pascal programming?
program interest;





var


cardBalance: real;


rate: real;


numMonths: integer;





begin


cardBalance := 5000.0;


rate := 0.02;


numMonths := 0;





while (cardBalance %26lt; 10000.0) do


begin


cardBalance := cardBalance + cardBalance * rate;


numMonths := numMonths + 1;


end;





end.Can you please help me about pascal programming?
If the bank charges you, you don't make money. The bank has to be paying interest for you to make money. Is it a flat rate or compounded? Does the interest return to the principal or is it separate from it?
oh cmon that sounds so EASYY


i don't know anything about pascal but here's the basic solution. I'm sure you can figure out what's going onn.





int balance = 5000;


int monthsCounter = 0;


while(balance %26lt; 10000) {


balance = balance + (balance * .02);


monthsCounter++;


}





return monthsCounter;

No comments:

Post a Comment