Here is my solution. I did the following:
- changed the setRemover into a constructor, since the comment seems to hint that that is expected.
- changed the lookFor type into a String, so that it can work with the string replace overload. That's convenient if you want to replace with an emtpy string. The char type won't let you do that, you can then only replace one char with another.
- Added a static Main routine to use the class.
import java.lang.System.*;
public class LetterRemover
{
private String sentence;
private String lookFor;
public LetterRemover() {}
// Constructor
public LetterRemover(String s, char rem)
{
sentence = s;
lookFor = String.valueOf(rem);
}
public String removeLetters()
{
String cleaned = sentence.replace(lookFor, "");
return cleaned;
}
public String toString()
{
return sentence + " - letter to remove " + lookFor;
}
public static void main(String[] args)
{
LetterRemover lr = new LetterRemover("This is the tester line.", 'e');
System.out.println(lr.toString());
String result = lr.removeLetters();
System.out.println("Resulting string: "+result);
}
}
The answer is most likely C
Answer:
The translator is the software that is called to translate the statement written by the developer and the result of the process is machine code which can be understood by the computer system.
Explanation:
- A translator is a software or processor which is responsible to convert the code into machine-executable language or machine code or binary language. This language is made up of 0 and 1.
- There are so many translators which are specific for any particular language. For example assembler and compiler.
- The above question wants to ask about the process which is used for translating a statement written by a developer which is a translator and the result of this process is machine code which is understood by the computer system.