Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class ChangeBureau {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int bitcoin = Integer.parseInt(scanner.nextLine());
  7.         double chineseYuan = Double.parseDouble(scanner.nextLine());
  8.         double commisionPercent = Double.parseDouble(scanner.nextLine());
  9.  
  10.        double bitcoinPriceLeva = 1168;
  11.        double yuanPriceDollar = 0.15; // dollar
  12.        double dollar = 1.76; // leva
  13.        double euro = 1.95;
  14.  
  15.        double yuanPriceToLev =  (chineseYuan * yuanPriceDollar) * 1.76;
  16.  
  17.        double finalPriceLev = (bitcoinPriceLeva * bitcoin) + yuanPriceToLev;
  18.        double finalPriceEuro = (bitcoinPriceLeva +  yuanPriceToLev) / 1.95;
  19.        double comissionValue = commisionPercent / 100;
  20.        double finalAnswer = finalPriceEuro - (finalPriceEuro * comissionValue);
  21.  
  22.  
  23.         System.out.printf("%.2f",finalAnswer);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement