Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class PlantNPV{
- private double[] FCI={187500, 437500, 437500, 187500};
- private double WC=130000;
- private double SU=110000;
- private double CF=410000;
- private double i;
- private double plantlife=10;
- public PlantNPV(){
- Scanner input =new Scanner (System.in);
- getTntrest(input);
- }
- private void getTntrest(Scanner input){
- this.i=-1;
- System.out.println("Enter a intrest rate in the form of a decimal inbetween and greater than zero\n");
- while((int)this.i==-1){
- this.i=input.nextDouble();
- if(this.i>0 & this.i<1){
- System.out.printf("Thank you for entering a valid value, i= %.2d%n", this.i);
- }else{
- System.out.printf("Error invalid value, i= %.2d%n",this.i);
- this.i=-1;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement