Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class convert {
- String finished;
- String[] operatorsToCheckFor = {"+", "/", "-", "*"};
- List<String> list = Arrays.asList(operatorsToCheckFor);
- public void setToConvert(String x)
- {
- if(x.isEmpty())
- {
- finished = "";
- }
- else
- {
- finished = x;
- doConvert();
- }
- }
- private void doConvert()
- {
- //lets see what the string contains
- if(finished.equals(list))
- {
- finished = "true";
- }
- else
- {
- finished = "false";
- }
- }
- public void returnTransformed()
- {
- if(finished.isEmpty())
- {
- System.out.println("There is no data to return. You didn't enter in a line of code to convert.");
- }
- else
- {
- System.out.println(finished);
- }
- }
- }
Add Comment
Please, Sign In to add comment