View Single Post
  #2 (permalink)  
Old 11-17-2007, 07:15 AM
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,222
hardwired is on a distinguished road
Code:
System.out.println(" enter amount invest:"); investmentAmount = input.nextDouble(); // investmentAmount = Double.parseDouble(input.nextLine()); System.out.println(" enter monthly Rate "); if(input.hasNextInt()) interestRate = input.nextDouble()/100.0; else interestRate = input.nextDouble(); /* // Using nextLine here required it be used for investmentAmount. String line = input.nextLine(); interestRate = Double.parseDouble(line); if(line.indexOf(".") == -1) interestRate /= 100.0; */
Reply With Quote