4-20) (Process a string) Write a program that prompts the user to enter a string and displays its length and its first character SAMPLE RUN #4: java StringLength- Interactive Session Hide Invisibles...


4-20) (Process a string)


Write a program that prompts the user to enter a string and displays its length and its first character.


Enter a string


The string is of length and the first character is


4-20) (Process a string) Write a program that prompts the user to enter a string and displays its length and its first character<br>SAMPLE RUN #4: java StringLength-<br>Interactive Session<br>Hide Invisibles<br>Highlight: None<br>Enter-a-string : Does . quantum-determinacy-have-anything-to-with-whether, human, cognition is-deterministic卍<br>The.string.is of-length.88.and.the.first.character.is D<br>SUBMIT<br>1 import java.util1.scanner;<br>3 public class StringLength f<br>4 public static void main(Stringl args)<br>5<br>scanner input = new scanner(system.in);<br>System.out.printlng Enter a string:

Extracted text: 4-20) (Process a string) Write a program that prompts the user to enter a string and displays its length and its first character SAMPLE RUN #4: java StringLength- Interactive Session Hide Invisibles Highlight: None Enter-a-string : Does . quantum-determinacy-have-anything-to-with-whether, human, cognition is-deterministic卍 The.string.is of-length.88.and.the.first.character.is D SUBMIT 1 import java.util1.scanner; 3 public class StringLength f 4 public static void main(Stringl args) 5 scanner input = new scanner(system.in); System.out.printlng Enter a string:"); String s-inp.nextlíne System.out.printin(" Length of the string is "+s.length))and the first character is +s.charAt(e); 18

Jun 01, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here