Advertisement
Guest User

Untitled

a guest
Aug 21st, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. package bilvarde;
  2.  
  3. import java.util.Scanner;
  4.  
  5. /**
  6.  *
  7.  * @author James
  8.  */
  9. public class BilVarde {
  10. private static final double depperecent = 12;
  11.    
  12. public static void main(String arg[])
  13. {
  14. long amount,year,afterdep,temp;
  15.  
  16. Scanner sc=new Scanner(System.in);
  17. System.out.println("enter amount");
  18. amount=sc.nextLong();
  19. System.out.println("enter  number of years");
  20. year=sc.nextLong();
  21. temp=amount;
  22. for(int i=0;i<year;i++)
  23. temp=((100-deppercent)*temp)/100;
  24. System.out.println("after depreciation = "+temp);
  25.        
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement