Advertisement
apez1

Term 1: Lesson 22 - Coding Activity 1

Sep 26th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Lesson_22_Activity_One {
  4.  
  5.     public static void main(String[] args) {
  6.        
  7.         Scanner scanner = new Scanner(System.in);
  8.         System.out.println("Please enter a string: ");
  9.         String input = scanner.nextLine();
  10.        
  11.         int length = input.length();
  12.        
  13.         int c = 0;
  14.        
  15.         while(c != length) {
  16.  
  17.         char display = input.charAt(c);
  18.        
  19.         System.out.println(display);
  20.         c++;
  21.            
  22.         }
  23.        
  24.     }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement