Answer:
Explanation:
The following code is written in Java and uses a for loop with a series of IF ELSE statements to check the next and previous characters in a string. Checking to make sure that there are no asterix. If so it adds that character to the String variable output. Which is returned to the user at the end of the method. Two test cases have been created and the output can be seen in the attached image below.
class Brainly {
public static void main(String[] args) {
System.out.println(starOut("sm*eilly"));
System.out.println(starOut("ab**cd"));
}
public static String starOut(String str) {
String output = "";
for (int i = 0; i < str.length(); i++) {
if ((i != 0) && (i != str.length()-1)) {
if ((str.charAt(i-1) != '*') && (str.charAt(i+1) != '*') && (str.charAt(i) != '*')) {
output += str.charAt(i);
}
} else {
if ((i == 0) && (str.charAt(i) != '*') && (str.charAt(i+1) != '*')) {
output += str.charAt(i);
} else if ((i == str.length()-1) && (str.charAt(i) != '*') && (str.charAt(i-1) != '*')) {
output += str.charAt(i);
}
}
}
return output;
}
}
Right when you pay for subscription to PSPlus the timer starts and after 30 days it will end ( if you got the 1 month subscription) This is the same for 3 month and 1 year subscription
Answer:
a group of instructions that can be used to organize a program or perform a repeated task
Explanation:
A function is a group of commands that can be called upon with extra parameters if needed.
Example:
def foo(): #defining this function and naming it foo
return True #what is performed when foo is called on
if foo() == True: #foo() is calling on a function named foo
print('yes')
What are the other options? Is this multiple choice or just fill in the blank