@glennyisbae/

The Name Game

Java

No description

fork
loading
Files
  • Main.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import java.util.Scanner;
class Main {
  public static void main(String[] args) {
    System.out.println("What is Your Name? (First and Last)");
    Scanner evan = new Scanner(System.in);
    String Name= evan.nextLine();
    String fName= Name.substring(0,Name.indexOf(" "));
    String lName= Name.substring(Name.indexOf(" ")+1);
    nameGame(fName);
    nameGame(lName);
  }
  public static void nameGame (String a){
    System.out.println(a+" "+a+", bo-B"+a.substring(1));
    System.out.println("Banana-fana fo-F"+a.substring(1));
    System.out.println("Fee-fi-mo-M"+a.substring(1));
    System.out.println(a.toUpperCase()+"!");
  }
}