
/*
Online Java - IDE, Code Editor, Compiler

Online Java is a quick and easy tool that helps you to build, compile, test your programs online.
*/

public class Main
{
    public static void main(String[] args) {
        System.out.println("Welcome to Online IDE!! Happy Coding :)");
        
        System.out.println("This will be simple example at moment demonstrating if there is arbitrage");
        System.out.println("To keep it simple, it will compare each currency against only one other currency");
        
        //int [][][] all Conversions = new int[]()
        
        // not sure how to store the integer arrays into a larger container..
        // perhaps create a 3d array... but not worrying at moment.
        
        // this is to verify no arbitrage
       
       // this is the same on horizontal and vertical
       String [] currency = new String[]{" ", "£","$","€"};
       
       //maybe need currency symbol outside of array
       //and then decalre as integer array?
       int currencies [][] =   {
                                 
                                 {1.00,1.25,1.17},
                                 {0.80,1.00,0.94},
                                 {0.85,1.07,1.00},
                                 
                                  };
      
       // since no indication of which currency is which, it will use indexof- at first index of 2d array.
      
      // determine which row to use
      //This is taken to be user inputs from Scanner. To be implemented later
      
      // This will first execute to test a single conversion from one currency to another and back again
      // it will be tested in normal conditions and then in arbitrage
      
      
      // NORMAL CONDITIONS ************************
      
      int count=0;
      ////Object k = null;
      
      String input = "£";
      String output = "$";
      int amount = 3;
      int inputRow=0;
      int outputRow=0;
      
      
      System.out.println(input+amount + " to be converted to " + "output");
      
      /*
      for (Object [] o: currencies)
      {
          count++;
          for (Object k: o)
          {
              if (k==input)
              {
                  System.out.println("Detected a: " + input + " on line: " + (count-1));
                  inputRow=count-1;
              }
              
              if (k==output)
              {
                  System.out.println("Detected a: " + output + " on line: " + (count-1));
                  outputRow=(count-1);
                  //row=k;
              }
              
          }
          
      }
      
      
      int column=0;
      int typeCurrency=0;
      int columnCurrency=0;
      
      
      
      for (String c: currency)
      {
          
          if (c==output)
          {
              System.out.println("Detected a: " + output + " in column: " + (column));
              
              typeCurrency=column;
              column++;
          }
     
    }
    */
    
    System.out.println("CONVERSION**************");
    
    //currencies[outputRow][typeCurrency];
    //currencies[outputRow][typeCurrency];
    
    int outcome = Integer.valueOf(currencies[outputRow][typeCurrency]);
    
     //System.out.println("This is conversion:" + typeCurrency + ((Number)(currencies[outputRow][columnCurrency]).intValue() * amount));
    
}
}
        // 