A row, which is also called a tuple.
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);
}
}
Answer:
Please find the attachment of query:
Explanation:
IIn the given query multiple select clauses and where the condition is used which can be defined as follows:
In this query first, we select the "Dept" column from the "COURSE" table, and in where clause it uses another select clause in this clause it selects the "Course#" column from the "BOOK_ADOPTION" table.
Inside this, another condition is used, that selects "Book_isbn" from the "TEXT" table and in where clause, it matches the publisher value that is "Addison-Wesley".
Answer:
It helps our body function
Explanation: