Created
September 5, 2012 21:58
-
-
Save anonymous/3645770 to your computer and use it in GitHub Desktop.
Austin's Convert Program
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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