Java Programming

   
 

Word Print - Iterating Through a String

 

import java.util.Scanner;

public class WordPrint {

public static void main(String[] args) {
// This program prompts the user for a string and then prints each character of the string, one character per line.

String word = "";
Scanner reader = new Scanner(System.in);

System.out.println("This program will count the characters in your word and then print them.");
System.out.println("Please enter a word");
word = reader.nextLine();

System.out.println("The word " + word + " has " + fill in the blank + " characters in it.");

for(fill in the blank )
{
System.out.println(fill in the blank);
}

System.out.println("Thank you for using this program.");

System.out.println("Have a Great Day.");


}


}