Monty374

Monogram

Oct 5th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. package monogram;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Monogram {
  6.  
  7. /**
  8. * @param args the command line arguments
  9. */
  10. public static void main(String[] args) {
  11. String first, middle, last;
  12. Scanner input = new Scanner(System.in);
  13.  
  14. System.out.print("Enter first name: ");
  15. first = input.nextLine();
  16.  
  17. System.out.print("\nEnter last name: ");
  18. last = input.nextLine();
  19.  
  20. System.out.print("\nEnter a middle initial: ");
  21. middle = input.nextLine();
  22.  
  23. first = first.substring(0,1);
  24. first = first.toLowerCase();
  25. last = last.substring(0,1);
  26. last = last.toUpperCase();
  27. middle = middle.substring(0,1);
  28. middle = middle.toLowerCase();
  29.  
  30. System.out.print("Your monogram is: " + first + last + middle);
  31.  
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment