Simple program to convert 07/RS3 exchange rates

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

Simple program to convert 07/RS3 exchange rates
  1. Unread #1 - Oct 22, 2013 at 3:45 AM
  2. kmjt
    Joined:
    Aug 21, 2009
    Posts:
    14,450
    Referrals:
    8
    Sythe Gold:
    449

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

    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");
    		}
    	}
    }
    
     
  3. Unread #2 - Oct 22, 2013 at 5:43 AM
  4. Pirates
    Joined:
    Oct 17, 2013
    Posts:
    21
    Referrals:
    0
    Sythe Gold:
    0

    Pirates Newcomer
    Banned

    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
     
  5. Unread #3 - Oct 22, 2013 at 2:42 PM
  6. kmjt
    Joined:
    Aug 21, 2009
    Posts:
    14,450
    Referrals:
    8
    Sythe Gold:
    449

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

    Simple program to convert 07/RS3 exchange rates

    Lol did you even use it?
     
  7. Unread #4 - Oct 23, 2013 at 6:07 AM
  8. Darkest Dream
    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

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

    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
     
  9. Unread #5 - Oct 23, 2013 at 6:30 AM
  10. kmjt
    Joined:
    Aug 21, 2009
    Posts:
    14,450
    Referrals:
    8
    Sythe Gold:
    449

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

    Simple program to convert 07/RS3 exchange rates


    What wording would you prefer?
     
  11. Unread #6 - Oct 23, 2013 at 10:37 AM
  12. Jayzz
    Joined:
    Aug 9, 2012
    Posts:
    443
    Referrals:
    0
    Sythe Gold:
    0

    Jayzz Forum Addict
    Banned

    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?
     
  13. Unread #7 - Oct 25, 2013 at 12:43 AM
  14. kmjt
    Joined:
    Aug 21, 2009
    Posts:
    14,450
    Referrals:
    8
    Sythe Gold:
    449

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

    Simple program to convert 07/RS3 exchange rates


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

Users viewing this thread
1 guest


 
 
Adblock breaks this site