Advertisement
myrdok123

USD to BGN

Oct 2nd, 2022
875
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. package FirstStepsInCoding.Exercise;
  2.  
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class UsdToBGN {
  7.  
  8.     public static void main(String[] args) {
  9.  
  10.         //създаваме си скенер
  11.         Scanner scanner = new Scanner(System.in);
  12.  
  13.         //четене от конзолата
  14.         double usd = Double.parseDouble(scanner.nextLine());
  15.  
  16.         //преобразуване от долар в лева
  17.         double bgn = usd * 1.79549;
  18.  
  19.         //принтиране на конзолата
  20.         System.out.println(bgn);
  21.  
  22.  
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement