Created
July 5, 2022 06:10
-
-
Save ievgiienko/e6a29f6892348f7e7d50e5e7bcf149fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
System.out.println("What is BTC price today?"); | |
var btc = scanner.nextDouble(); | |
while (true) { | |
System.out.println("How much $ do you have?"); | |
var usd = scanner.nextDouble(); | |
if (usd == 0) | |
break; | |
var result = usd / btc; | |
System.out.println("You will get " + result + " BTC!"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment