Assignement: #86 Letters at a Time using For Loop
Code
/// Name: Sean Harrison
/// Period: 7
/// Program name: LetterTime
/// File Name: LetterTime.java
/// Date Finished: 3/1/2016
import java.util.Scanner;
public class LetterTime
{
public static void main ( String[] args )
{
Scanner kb = new Scanner(System.in);
System.out.print( " WHat is your message? " );
String message = kb.nextLine();
System.out.println("\nYour message is " + message.length() + " characters long." );
System.out.println( "The first character is at postion 0 and is ' " + message.charAt(0) + "'.");
int lastpos = message.length() - 1;
System.out.println("The last character is at position " + lastpos + " and is '" + message.charAt(lastpos) + "'.");
System.out.println("\nHere are all the characters, one at a time:\n");
for ( int i=0; i
Picture of the output