Skip to content

Instantly share code, notes, and snippets.

@ievgiienko
Created May 31, 2023 14:51
Show Gist options
  • Save ievgiienko/79b6a19982a894bbd8293065ddda4d81 to your computer and use it in GitHub Desktop.
Save ievgiienko/79b6a19982a894bbd8293065ddda4d81 to your computer and use it in GitHub Desktop.
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