Ivakis

Money

Oct 30th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class demo {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int bitcoin = Integer.parseInt(scanner.nextLine());
  8. double cny = Double.parseDouble(scanner.nextLine());
  9. double commissionRate = Double.parseDouble(scanner.nextLine());
  10.  
  11. int bitcoinToLv = bitcoin * 1168;
  12. double cnyToUsd = cny * 0.15;
  13. double cnyToLv = cnyToUsd * 1.76;
  14.  
  15. double euro = (bitcoinToLv + cnyToLv) / 1.95;
  16.  
  17. double commission = euro * (commissionRate / 100);
  18.  
  19. double result = euro - commission;
  20.  
  21. System.out.printf("%.2f", result);
  22.  
  23. }
  24. }
Add Comment
Please, Sign In to add comment