Skip to content

Instantly share code, notes, and snippets.

Created September 5, 2012 21:58
Show Gist options
  • Save anonymous/3645770 to your computer and use it in GitHub Desktop.
Save anonymous/3645770 to your computer and use it in GitHub Desktop.
Austin's Convert Program
import java.util.Scanner;
public class Convert
{
public static void main(String[] args)
{
//allowing us to take input from the keyboard
Scanner keyboard = new Scanner(System.in);
//delcaring variables
double dollar;
int country;
final double england_1 = .63;
final double japan_2 = 78.5;
final double china_3 = 6.36;
double convert;
double convert_2;
double convert_3;
//asking the user for dollar amount and country
System.out.println("Enter the US dollar ammount:");
dollar = keyboard.nextDouble();
System.out.println("Choose one of the following countries\n1. England\n2. Japan\n3. China");
country = keyboard.nextInt();
if (country == 1)
//convert = dollar * england_1;
System.out.println(dollar + " dollars is equal to " + dollar * england_1 " pounds.");
//else if (country == 2)
//convert_2 == dollar * japan_2;
//System.out.println(dollar + " dollars is equal to " + convert_2);
//else (country == 3)
//convert_3 == dollar * china_3;
//System.out.println(dollar + " dollars is equal to " + convert_3);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment