import java.util.*;
public class Kopi
{
static Scanner console=new Scanner(System.in);
public static void main(String[]args)
{
String f;
double a,z,y,x,w;
System.out.println("Enter a currency you wish to convert:");
System.out.println("dollars,swiss,euro,mexican");
f=console.next();
System.out.println("okay");
System.out.println("Enter a value:");
a=console.nextInt();
System.out.println("you have:");
double euro= 0.9553;
double swiss=1.4054;
double mexican=9.815;
double dollars=1.0000;
z=a*euro;
y=a*swiss;
x=a*mexican;
w=a*dollars;
System.out.println("euro="+ z);
System.out.println("swiss="+y);
System.out.println("mexican="+x);
System.out.println("dollars="+w);
}
}
(this is my code)
WHAT CODE SHOUD I ADD TO MY PROGRAM IF I WILL ENTER EURO(currency) IT WILL NOT APPEAR WITH THE VALUE IT SELF
SAMPLE OUTPUT:Enter a currency you wish to convert: DOLLARS
Enter a value: 100
Swiss:__________
Euro:___________
Mexican:_________
coz in my program if i choose a currency sample dollar it will appear the value of dollar ..so i want it only display 3(swiss,euro,mexican) currency in coresponding converts.thats only my problem..i want to know what to add a code or program.... pls!help me!