Advertisement
KeeganT

Ch6Ex18

Feb 20th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. package ch6ex18;
  2. import java.util.Scanner;
  3.  
  4. public class Ch6Ex18
  5. {
  6.     public static void main(String[] args)
  7.     {
  8.         Scanner sc=new Scanner(System.in);
  9.         System.out.print("Enter your first name: ");
  10.         String first=sc.nextLine();
  11.         first=first.toLowerCase();
  12.         char[] fArray=first.toCharArray();
  13.         System.out.print("Enter your middle name: ");
  14.         String middle=sc.nextLine();
  15.         middle=middle.toLowerCase();
  16.         char[] mArray=middle.toCharArray();
  17.         System.out.print("Enter your last name: ");
  18.         String last=sc.nextLine();
  19.         last=last.toUpperCase();
  20.         char[] lArray=last.toCharArray();
  21.         System.out.println("Your monogram is: "+fArray[0]+lArray[0]+mArray[0]);
  22.     }  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement