@@ -0,0 +1,1444 @@
+/*%0A  Write a program that prompts the user to enter the exchange rate from%0A  currency in US dollars to Chinese RMB. Prompt the user to enter 0 to convert%0A  from US dollars to Chinese RMB and 1 to convert from Chinese RMB to US%0A  dollars. Prompt the user to enter the amount in US Dollars or Chinese RMB%0A  to convert it to Chinese RMB or US dollars, respectively.%0A*/%0A%0Aimport java.util.Scanner;%0A%0Apublic class E3_31 %7B%0A  public static void main(String%5B%5D args) %7B%0A    Scanner input = new Scanner(System.in);%0A    System.out.print(%22Enter the exchange rate from dollars to RMB: %22);%0A    double xRate = input.nextDouble();%0A    System.out.print(%22Enter 0 to convert dollars to RMB and 1 vice versa: %22);%0A    int direction = input.nextInt();%0A    if (direction != 0 && direction != 1) %7B%0A      System.out.println(%22Incorrect input%22);%0A      System.exit(1);%0A    %7D else if (direction == 0) %7B%0A      System.out.print(%22Enter the dollar amount: %22);%0A    %7D else %7B%0A      System.out.print(%22Enter the RMB amount: %22);%0A    %7D%0A    double amount = input.nextDouble();%0A%0A    double newCurrency = 0.0;%0A    if (direction == 0) %7B%0A      newCurrency = amount * xRate;%0A    %7D else %7B%0A      newCurrency = amount / xRate;%0A    %7D%0A%0A    System.out.print(amount + (direction == 0 ? %22 dollars%22 : %22 yuan%22) +%0A      %22 is %22);%0A    if (direction == 1) %7B%0A      System.out.printf(%22$%25.2f%22, newCurrency);%0A    %7D else %7B%0A      System.out.printf(%22%25.2f yuan%22, newCurrency);%0A    %7D%0A    System.out.println();%0A  %7D%0A%7D%0A

Correct the output formatting