Assignment 86, Letter at a Time
Code
///Name: Stella Koliavas
///Period: 5
///File Name: Letters.java
///Date Finshed: 2/19/16
import java.util.Scanner;
public class Letters
{
public static void main( String[] args )
{
Scanner siri = new Scanner(System.in);
System.out.print("What is your message? ");
String message = siri.nextLine();
System.out.println("\nYour message is " + message.length() + " characters long.");
System.out.println("The first character is at position 0 and is '" + message.charAt(0)
+ "'.");
int last = message.length() - 1;
System.out.println("The last character is at position " + last + " and is '" +
message.charAt(last) + "'.");
System.out.println("\nHere are all the characters, one at a time:\n");
//box is 3 characters long and x is at the 2nd position
for ( int i=0; i
Picture of the output