Question: Variable inString is assigned with a 3-character string read from input. If inString's first, second, and third characters are all digits, output String is valid.
Variable inString is assigned with a 3-character string read from input. If inString's first, second, and third characters are all digits, output "String is valid". Otherwise, output "String is not valid". End each output with a newline. Ex 1: If the input is 727, then the output is: String is valid Ex 2: If the input is p40, then the output is: String is not valid 1 import java. util. Scanner; public class StringModification { YOUSWNP public static void main (String args) { Scanner scor = new Scanner (System. in); String inString; 8 inString = scor . nextLine( ); 10 /* Your code goes here */ 11 12 13 }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
