Advertisement
CoineTre

Exam_01March2020

Oct 15th, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class CurrencyExchange {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int bitcoins = Integer.parseInt(scanner.nextLine());
  7.         double yuans = Double.parseDouble(scanner.nextLine());
  8.         double commission = Double.parseDouble(scanner.nextLine());
  9.         double changeBitcoinsLeva = bitcoins *1168;
  10.         double changeYuansLeva = (yuans * 0.15)*1.76;
  11.         double euroRateLv = 1.95;
  12.         double euro = (changeBitcoinsLeva + changeYuansLeva) / euroRateLv;
  13.         double commissioCalculation = euro * (commission/100);
  14.         System.out.printf("%.2f",(euro - commissioCalculation));
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement