Nackey

Money - task

Jul 18th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Coins {
  4.     public static void main(String[] args) {
  5.         Scanner sc = new Scanner(System.in);
  6.  
  7.         int bitcoins = Integer.parseInt(sc.nextLine());
  8.         double uans = Double.parseDouble(sc.nextLine());
  9.         double comm = Double.parseDouble(sc.nextLine());
  10.         double bitcoinLeva = bitcoins*1168;
  11.         double uani = uans*0.15;
  12.         double uaniLeva = uani*1.76;
  13.         double sum = ((bitcoinLeva+uaniLeva)/1.95);
  14.         double commi = (sum*comm)/100;
  15.         double result = sum-commi;
  16.  
  17.         System.out.printf("%.2f", result);
  18.  
  19.  
  20.     }
  21. }
Add Comment
Please, Sign In to add comment