title: Trying to combine multiple programs together
body: <p>I am trying to take 3 different programs I have created and put them under a single class. My professor has stated I must do this and I have no clue on how to. I am not looking for a hand out here, just some how I can do this quickly and efficiently. I am also trying to figure out how to call from the same scanner for each program or if I should just make multiple ones.</p>
  
  <pre><code>import java.util.Scanner;
  public class AssignmentOneFahrenheit {
  
  public static void main(String[] args) {
      // TODO Auto-generated method stub
      System.out.println("Hello, I can convert Fahrenheit to Celsius!");
      System.out.println("Please enter the degrees Fahrenheit you want converted.");
  
      double degreesF;
      double degreesC;
  
      Scanner keyboard = new Scanner(System.in);
  
      degreesF = keyboard.nextDouble(); //Allows user to input decimal number
      keyboard.close();
      System.out.println("The temperature in Degrees Celsius is: ");
      degreesC = 5*(degreesF - 32)/9;
      System.out.printf("%.2f", degreesC);
  }
  
  import java.util.Scanner;
  public class AssignmentOneHate {
  
  public static void main(String[] args) {
      // TODO Auto-generated method stub
  
      Scanner keyboard = new Scanner(System.in);
      System.out.println("Please enter a line containing 'hate'.");
      String text = keyboard.nextLine();
  
      System.out.println("I have changed that line to read: ");
      System.out.println(text.replaceFirst("hate", "love"));
      keyboard.close();
  }
  
  
  import java.util.Scanner;
  public class AssignmentOneVerticalDisplay {
  
  public static void main(String[] args) {
      // TODO Auto-generated method stub
  
      int userInput;
  
      System.out.println("Please enter a 4 digit integer.");
  
      Scanner keyboard = new Scanner(System.in);
  
      userInput = keyboard.nextInt();
      System.out.println(userInput / 1000);
      userInput = userInput % 1000;
      System.out.println(userInput / 100);
      userInput = userInput % 100;
      System.out.println(userInput / 10);
      System.out.println(userInput % 10);
  
      keyboard.close();
  }
  
  }
  </code></pre>
  
  <p>I basically just copied and pasted 2 programs I created. If anybody can help guide me in the correct direction here that would be great.</p>