Guest User

Untitled

a guest
Nov 25th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class convert {
  4.  
  5. String finished;
  6. String[] operatorsToCheckFor = {"+", "/", "-", "*"};
  7. List<String> list = Arrays.asList(operatorsToCheckFor);
  8.  
  9. public void setToConvert(String x)
  10. {
  11. if(x.isEmpty())
  12. {
  13. finished = "";
  14. }
  15. else
  16. {
  17. finished = x;
  18. doConvert();
  19. }
  20. }
  21.  
  22. private void doConvert()
  23. {
  24. //lets see what the string contains
  25. if(finished.equals(list))
  26. {
  27. finished = "true";
  28. }
  29. else
  30. {
  31. finished = "false";
  32. }
  33. }
  34.  
  35. public void returnTransformed()
  36. {
  37. if(finished.isEmpty())
  38. {
  39. System.out.println("There is no data to return. You didn't enter in a line of code to convert.");
  40. }
  41. else
  42. {
  43. System.out.println(finished);
  44. }
  45. }
  46. }
Add Comment
Please, Sign In to add comment