// Allison Obourn
// CS 141, Winter 2021
// Lecture 7

// This program prompts the user for the name of two company founders and 
// whether the company is on the west coast (yes or no). If it is on the west
// coasts it suggests the first half of the second name then the first half
// of the first name as a company name. Otherwise it suggests the first half
// of the first person's name and then the first half of the second person's 
// name as a company name. 

import java.util.*;

public class CompanyName {
   public static void main(String[] args) {
      Scanner input = new Scanner(System.in);
      System.out.print("Founder 1 name? ");
      String person1 = input.next();
      System.out.print("Founder 2 name? ");
      String person2 = input.next();
      System.out.print("On the west coast? ");
      String west = input.next();
      
      String halfName1 = person1.substring(0, person1.length() / 2);
      String halfName2 = person2.substring(0, person2.length() / 2);

      String name = halfName1 + halfName2;
      if(west.equalsIgnoreCase("yes")) {
         name = halfName2 + halfName1;
      } 
      name = name.toUpperCase();
      System.out.println("Suggested company name: " + name);
      
   }
}