• Log in or sign up for an account here: https://www.sythe.org/login

Simple program to convert 07/RS3 exchange rates

Joined
Aug 21, 2009
Sythe Gold
449
Messages
14,450
Location
Canada
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


2v8h7pu.png




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");
		}
	}
}
 
I might be doing it wrong but I got an error, will post it in just a minute
 
Any suggestions as far as which Java IDE a noob like myself could download in order to use the helpful tool you wrote?
 
duelarena.gg
Back
Top