Created
May 31, 2023 14:51
-
-
Save ievgiienko/79b6a19982a894bbd8293065ddda4d81 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
package org.example; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
var scanner = new Scanner(System.in); | |
System.out.println("What is BTC price today?"); | |
var rate = scanner.nextDouble(); | |
while (true) { | |
System.out.println("How mush $ do you have?"); | |
var dollars = scanner.nextDouble(); | |
if (dollars == 0) | |
break; | |
var result = dollars / rate; | |
System.out.println("Result = " + result); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment