Question: CHALLENGE ACTIVITY 3 . 1 6 . 1 : More string operations. 5 2 8 0 4 0 . 3 4 8 9 5 2

CHALLENGE
ACTIVITY
3.16.1: More string operations.
528040.3489528.93zqy7
Jump to level 1
String inputString is read from input. If inputString does not contain character 'u' at or after index 4, then output "Character 'u' is not found at or after index 4." Otherwise, output:
"Starting at index 4, the first occurrence of character 'u' is at index"
the index of the first occurrence of 'u' at or after index 4 in inputString
"."
End with a newline.
Ex: If the input is surrendered, then the output is:
Character 'u' is not found at or after index 4.
Ex: If the input is constructing, then the output is:
Starting at index 4, the first occurrence of character 'u' is at index 6.
import java.util.Scanner;
public class FindCharacter {
public static void main(String[] args){
Scanner scnr = new Scanner(
System.in);
String inputstring;
int index;
inputstring = scnr. next();
}
}
 CHALLENGE ACTIVITY 3.16.1: More string operations. 528040.3489528.93zqy7 Jump to level 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!