Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class PlantNPV{
  4. private double[] FCI={187500, 437500, 437500, 187500};
  5. private double WC=130000;
  6. private double SU=110000;
  7. private double CF=410000;
  8. private double i;
  9. private double plantlife=10;
  10.  
  11.  
  12. public PlantNPV(){
  13. Scanner input =new Scanner (System.in);
  14. getTntrest(input);
  15. }
  16.  
  17. private void getTntrest(Scanner input){
  18. this.i=-1;
  19. System.out.println("Enter a intrest rate in the form of a decimal inbetween and greater than zero\n");
  20. while((int)this.i==-1){
  21. this.i=input.nextDouble();
  22. if(this.i>0 & this.i<1){
  23. System.out.printf("Thank you for entering a valid value, i= %.2d%n", this.i);
  24. }else{
  25. System.out.printf("Error invalid value, i= %.2d%n",this.i);
  26. this.i=-1;
  27. }
  28. }
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement