while loop!!!! dont know how to do it???

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Apr 2009
Posts: 11
Reputation: king_786 is an unknown quantity at this point 
Solved Threads: 0
king_786 king_786 is offline Offline
Newbie Poster

while loop!!!! dont know how to do it???

 
0
  #1
Apr 8th, 2009
i am stuk on this and have a[solutly no idea in how to create the while loop!!!

could someone please show me how to do this???

Write a Java application that calculates the number of repayments for a loan based on the initial loan amount, annual interest rate and monthly payment. The user enters these values and application uses a loop to display the balance each month after payment has been made. Note that interest is charged each month on the remaining balance.

For this exercise, you need to use a while loop that repeats as long as the balance is greater than zero to calculate the new balance with interest after each payment. The body of the loop calculates the new balance plus monthly interest (monthly interest = annual interest rate / 12) and then subtracts the payment. Note that it may be possible for the last payment to be less than the usual monthly payment. In this case you need to take this into account by only subtracting the amount necessary to clear the outstanding balance and not the full monthly payment.

Below is an example of how a user would interact with the application, use this as a guide when designing the input and output of your application.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 1
Reputation: Thebigbottom is an unknown quantity at this point 
Solved Threads: 0
Thebigbottom Thebigbottom is offline Offline
Newbie Poster

Re: while loop!!!! dont know how to do it???

 
0
  #2
Apr 8th, 2009
can you post your code that you have already written.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 11
Reputation: king_786 is an unknown quantity at this point 
Solved Threads: 0
king_786 king_786 is offline Offline
Newbie Poster

Re: while loop!!!! dont know how to do it???

 
0
  #3
Apr 8th, 2009
thats wah i mean i dnt knw hw 2 start it
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,213
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 489
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: while loop!!!! dont know how to do it???

 
-1
  #4
Apr 8th, 2009
While loop with checking if expression is valid
  1. int i = 0;
  2. while( i < 10){
  3. i++;
  4. }

Do-while, will run at least once so make sure it has something to process and doesn't give you any Exceptions
  1. int i = 10;
  2. do{
  3. i--;
  4. }while(i > 0);
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,489
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 517
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: while loop!!!! dont know how to do it???

 
0
  #5
Apr 8th, 2009
Originally Posted by king_786 View Post
thats wah i mean i dnt knw hw 2 start it
Drop the lazy "chat speak". Read the forum rules regarding posting in proper English.
This is about the fourth homework assignment that you have posted verbatim without showing any effort or even a thought on the matter. This is not a homework completion service. Post your code and ask specific questions if you want help with something.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 1,619
Reputation: BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all 
Solved Threads: 205
BestJewSinceJC BestJewSinceJC is offline Offline
Posting Virtuoso

Re: while loop!!!! dont know how to do it???

 
1
  #6
Apr 8th, 2009
Originally Posted by Ezzaral View Post
This is not a homework completion service.
It depends. If he posts it in the 'paid projects' section it will quickly become one.
Last edited by BestJewSinceJC; Apr 8th, 2009 at 8:16 pm.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC