Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. import java.lang.Math;
  2. import java.util.Scanner;
  3. import java.text.NumberFormat;
  4. import java.io.*;
  5. import javax.swing.JOptionPane;
  6.  
  7. public class currencyConverterPAU
  8. {
  9.  
  10. public static void main(String[] args)
  11. {
  12.  
  13. String currency1;
  14. String currency2;
  15. double amount;
  16.  
  17. Scanner input=new Scanner(System.in);
  18.  
  19. // displaying options for outcome\\
  20.  
  21. System.out.println(" Welcome to Clinton's Currency Converter ");
  22.  
  23. int ValidCurrency = 0;
  24. while(ValidCurrency == 0)
  25. {
  26. System.out.println(" What currency are you converting from (proper grammar please) ");
  27. currency1=input.nextLine();
  28. System.out.println(currency1);
  29. if (!currency1.contains("U.S Dollar") && !currency1.contains("Canadian Dollar") && !currency1.contains("Euro") && !currency1.contains("Pound") && !currency1.contains("Yen") && !currency1.contains("Franc") && !currency1.contains("Rupee"))
  30. {
  31. System.out.println(" Invalid / Not added yet!");
  32. System.out.println(" Try another currency: ");
  33. currency1=input.nextLine();
  34.  
  35. }
  36. else{
  37. System.out.println(" gucci ");
  38. ValidCurrency = 1;
  39. }
  40. }
  41.  
  42.  
  43.  
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement