Adblock breaks this site

Simple program to convert 07/RS3 exchange rates

Discussion in 'Market Discussion' started by kmjt, Oct 22, 2013.

  1. kmjt

    kmjt -.- The nocturnal life chose me -.-
    Banned

    Joined:
    Aug 21, 2009
    Posts:
    14,450
    Referrals:
    8
    Sythe Gold:
    449
    Simple program to convert 07/RS3 exchange rates

    For those with a java IDE... enjoy

    Brief explanation
    Answer what kind of gp you are exchanging for (07/rs3)
    Answer how much of the gp you have to exchange for your desired gp
    Answer 07 price/m
    Answer RS3 price/m


    [​IMG]



    Code:
    import java.util.Scanner;
    
    public class RSConvert 
    {
    	public static void main(String[] args)
    	{
    		Scanner input = new Scanner(System.in);
    		
    		System.out.print("Which gp do you wish to exchange for? (07/rs3): ");
    		String currency = input.next();
    		
    		double amount = 0;
    		if(currency.equalsIgnoreCase("07"))
    		{
    			System.out.print("How much RS3 mills do you have to exchange?: ");
    			amount = input.nextDouble();
    		}
    		
    		else if(currency.equalsIgnoreCase("rs3"))
    		{
    			System.out.print("How much 07 mills do you have to exchange?: ");
    			amount = input.nextDouble();
    		}
    		
    		System.out.print("Enter RS3 price per mill: ");
    		double rs3Price = input.nextDouble();
    		
    		System.out.print("Enter 07 price per mill: ");
    		double oldSchoolPrice = input.nextDouble();
    		
    		double conversionRateRS3 = rs3Price/oldSchoolPrice;
    		double conversionRate07 = oldSchoolPrice/rs3Price;
    		
    		System.out.print("\nHow much 07gp an RS3 mill is worth -- ");
    		System.out.printf("%1$.2f", conversionRateRS3);
    		System.out.println("m");
    		System.out.print("How much RS3gp an 07 mill is worth -- ");
    		System.out.printf("%1$.2f", conversionRate07);
    		System.out.println("m\n");
    		
    		if(currency.equalsIgnoreCase("07"))
    		{
    			System.out.print("Amount of 07gp you should get for your " + amount + "m RS3 gp -- ");
    			System.out.printf("%1$.2f", amount*conversionRateRS3);
    			System.out.println("m");
    		}
    			
    		else if(currency.equalsIgnoreCase("rs3"))
    		{
    			System.out.print("Amount of RS3gp you should get for your " + amount + "m 07 gp -- ");
    			System.out.printf("%1$.2f", amount*conversionRate07);
    			System.out.println("m");
    		}
    	}
    }
    
     
  2. Pirates

    Pirates Newcomer
    Banned

    Joined:
    Oct 17, 2013
    Posts:
    21
    Referrals:
    0
    Sythe Gold:
    0
    Simple program to convert 07/RS3 exchange rates

    I might be doing it wrong but I got an error, will post it in just a minute
     
  3. kmjt

    kmjt -.- The nocturnal life chose me -.-
    Banned

    Joined:
    Aug 21, 2009
    Posts:
    14,450
    Referrals:
    8
    Sythe Gold:
    449
    Simple program to convert 07/RS3 exchange rates

    Lol did you even use it?
     
  4. Darkest Dream

    Darkest Dream I prefer to have my nightmares with open eyes.
    Darkest Dream Donor

    Joined:
    Jun 26, 2013
    Posts:
    7,457
    Referrals:
    1
    Sythe Gold:
    544
    Vouch Thread:
    Click Here
    Discord Unique ID:
    624783392625524785
    Sythe RSPS Player Two Factor Authentication User In Memory of Jon Christmas 2015 Doge Halloween 2013 Sythe's 10th Anniversary Off Topic Participant Gohan has AIDS
    Heidy Lawrence
    Simple program to convert 07/RS3 exchange rates

    Works nicely, you should consider adding in some error checking next c:

    edit: could also clean up the wording that will appear on the console and pack it into a jar file so that anyone can try it out =p
     
  5. kmjt

    kmjt -.- The nocturnal life chose me -.-
    Banned

    Joined:
    Aug 21, 2009
    Posts:
    14,450
    Referrals:
    8
    Sythe Gold:
    449
    Simple program to convert 07/RS3 exchange rates


    What wording would you prefer?
     
  6. Jayzz

    Jayzz Forum Addict
    Banned

    Joined:
    Aug 9, 2012
    Posts:
    443
    Referrals:
    0
    Sythe Gold:
    0
    Simple program to convert 07/RS3 exchange rates

    Any suggestions as far as which Java IDE a noob like myself could download in order to use the helpful tool you wrote?
     
  7. kmjt

    kmjt -.- The nocturnal life chose me -.-
    Banned

    Joined:
    Aug 21, 2009
    Posts:
    14,450
    Referrals:
    8
    Sythe Gold:
    449
    Simple program to convert 07/RS3 exchange rates


    Personally I use Eclipse.
     
< Different trading systems | How do you prefer to trade? >


 
 
Adblock breaks this site