-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCurrency.java
More file actions
27 lines (20 loc) · 907 Bytes
/
Currency.java
File metadata and controls
27 lines (20 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package introduction;
import java.util.*;
import java.text.*;
public class Currency {
public static void main(String[] args) throws ParseException {
Scanner scanner = new Scanner(System.in);
double payment = scanner.nextDouble();
scanner.close();
// Write your code here.
String us,india,china,france;
us = NumberFormat.getCurrencyInstance(Locale.US).format(payment);
india = NumberFormat.getCurrencyInstance(new Locale("en","IN")).format(payment);
china = NumberFormat.getCurrencyInstance(Locale.CHINA).format(payment);
france = NumberFormat.getCurrencyInstance(Locale.FRANCE).format(payment);
System.out.println("US: " + us);
System.out.println("India: " + india);
System.out.println("China: " + china);
System.out.println("France: " + france);
}
}