import java.io.FileWriter;
import java.io.IOException;
interface Currency {
double getCurrency(double basa);
}
class Bitcoin implements Currency{
@Override
public double getCurrency(double basa) {
return basa;
}
}
class Ethereum implements Currency{
@Override
public double getCurrency(double basa) {
return basa/49.42;
}
}
class XRP implements Currency{
@Override
public double getCurrency(double basa) {
return 36861.2;
}
}
class Bitcoin_cash implements Currency{
@Override
public double getCurrency(double basa) {
return basa/24.32;
}
}
class Bitcoin_Sv implements Currency{
@Override
public double getCurrency(double basa) {
return basa/34.22;
}
}
class Tether implements Currency{
@Override
public double getCurrency(double basa) {
return basa/9178.44;
}
}
class LiteCoin implements Currency{
@Override
public double getCurrency(double basa) {
return basa/135.37;
}
}
class EOS implements Currency{
@Override
public double getCurrency(double basa) {
return basa/2249.617;
}
}
class Binance_Coin implements Currency{
@Override
public double getCurrency(double basa) {
return basa/508.5;
}
}
class Cardano implements Currency{
@Override
public double getCurrency(double basa) {
return basa/169971;
}
}
public class Crypto {
public static void main (String[] args){
double bitock = 14552;
FileWriter fr =null;
String str ="LOL";
String str1 = ("price Bitcoin = " + (char)
new Bitcoin().getCurrency(bitock));
String str2 = ("price Ethereum = " + (char)
new Ethereum().getCurrency(bitock));
String str3 = ("price XRP = " + (char)
new XRP().getCurrency(bitock));
String str4 = ("price Bitcoin_cash = " + (char)
new Bitcoin_cash().getCurrency(bitock));
String str5 = ("price Bitcoin_SV = " + (char)
new Bitcoin_Sv().getCurrency(bitock));
String str6 = ("price Tether = " + (char)
new Tether().getCurrency(bitock));
String str7 = ("price LiteCoin = " + (char)
new LiteCoin().getCurrency(bitock));
String str8 = ("price EOS = " + (char)
new EOS().getCurrency(bitock));
String str9 = ("price Binance_Coin = " + (char)
new Binance_Coin().getCurrency(bitock));
String str10 = ("price Cardano = " + (char)
new Cardano().getCurrency(bitock));
try {
fr = new FileWriter("Crypto.txt",false);
fr.write(str);
fr.write(str1);
fr.write(str2);
fr.write(str3);
fr.write(str4);
fr.write(str5);
fr.write(str6);
fr.write(str7);
fr.write(str8);
fr.write(str9);
fr.write(str10);
}catch (IOException e) {
e.printStackTrace();
} finally{
try {
fr.close();
}catch (IOException e){
e.printStackTrace();
}
}
}
}