Advertisement
Guest User

java shit

a guest
Jul 17th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class TheNameGame {
  4. public static void main(String args[]){
  5. Scanner kybd = new Scanner(System.in);
  6. String firstname = kybd.nextLine();
  7. String lastname = kybd.nextLine();
  8. all(firstname, lastname);
  9. }
  10. public static void all(String first, String last){
  11. System.out.println("What is your name? " + first + " " + last);
  12. chant(first);
  13. chant(last);
  14. }
  15. public static void chant(String first){
  16. String nofirstletter = first.substring(1);
  17. System.out.println(first + " " + first + ", bo-B" + nofirstletter);
  18. System.out.println("Banana-fana fo-F" + nofirstletter);
  19. System.out.println("Fee-fi-mo-M" + nofirstletter);
  20. String allcaps = first.toUpperCase();
  21. System.out.println(allcaps + "!");
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement