title: How do I correctly format my code to run this menu program in Java?
body: <p>This is a beginner question. I'm about to start an online bootcamp and am stuck on my last pre-work project (which is a cumulation of everything we've been instructed to self-teach ourselves). I'm really lost and can't wrap my head around this.</p>
  <p>Here is what I've come up with so far:</p>
  <pre><code>import java.util.Scanner;
  
  public class Objective9Lab5 {
  
    public static void main(String[] args) {
      Scanner kb = new Scanner (System.in);
          double num1, num2;
          boolean keepGoing = true;
          int choice;
          double answer = 0.0;
      double calcTax;
  
      System.out.print(&quot;Please give me a number: &quot;);
      num1 = kb.nextDouble();
      System.out.print(&quot;Please give me another number: &quot;);
      num2 = kb.nextDouble();
  
          while (keepGoing) {
              System.out.print(&quot;Which would you like to do? &quot;);
              choice = kb.nextInt();
        double average = findAverage(num1, num2);
  
              switch (choice) {
          case 1:
            System.out.println(+ num1 + &quot; + &quot; + num2 + &quot; = &quot;);
            break;
          case 2:
            System.out.println(&quot;The average of &quot; + num1 + &quot;and&quot; + num2 + &quot;is&quot; + average);
            break;
          case 3:
            System.out.println(&quot;The amount in tax to be collected from a purchace of &quot; + num1 + &quot;and &quot; + num2 + &quot;is &quot; + calcTax);
            break;
          case 4: System.out.println(&quot;You've chosen to quit.&quot;);
            System.exit(0);
            return;
          default:
            System.out.println(&quot;Invalid entry. Please try again.&quot;);
            selection = scanner.nextInt();
          }
          kb.close();
      }
      public static void printMenu() {
          System.out.println();
          System.out.println(&quot;========= MENU =========&quot;);
          System.out.println(&quot;|                      |&quot;);
          System.out.println(&quot;|   1. Add Numbers     |&quot;);
          System.out.println(&quot;|   2. Find Average    |&quot;);
          System.out.println(&quot;|   3. Calculate Tax   |&quot;);
          System.out.println(&quot;|   4. Exit            |&quot;);
          System.out.println(&quot;|                      |&quot;);
          System.out.println(&quot;========================&quot;);
          System.out.println();
      }
  
      public static double findSum(double x, double y) {
          double sum = x + y;
          return sum;
    }
    public static double findAverage(double x, double y){
      double average = (x + y) / 2;
      return average;
    }
    public static double findCalcTax(double x, double y){
      double sum * .831
      }
  </code></pre>
  <p>My output is supposed to look something like this:</p>
  <pre><code>Please give me a number: 2
  Please give me another number: 8
  
  ========= MENU =========
  |                      |
  |   1. Add Numbers     |
  |   2. Find Average    |
  |   3. Calculate Tax   |
  |   4. Exit            |
  |                      |
  ========================
  
  Which would you like to do? 1
  2.0 + 8.0 = 10.0
  
  ========= MENU =========
  |                      |
  |   1. Add Numbers     |
  |   2. Find Average    |
  |   3. Calculate Tax   |
  |   4. Exit            |
  |                      |
  ========================
  
  Which would you like to do? 2
  The average of 2.0 and 8.0 is: 5.0
  
  ========= MENU =========
  |                      |
  |   1. Add Numbers     |
  |   2. Find Average    |
  |   3. Calculate Tax   |
  |   4. Exit            |
  |                      |
  ========================
  
  Which would you like to do? 3
  The amount in tax to be collected from a purchase of 2.0 and 8.0 is: 0.831
  
  ========= MENU =========
  |                      |
  |   1. Add Numbers     |
  |   2. Find Average    |
  |   3. Calculate Tax   |
  |   4. Exit            |
  |                      |
  ========================
  
  Which would you like to do? 5
  Invalid entry.  Please try again
  
  ========= MENU =========
  |                      |
  |   1. Add Numbers     |
  |   2. Find Average    |
  |   3. Calculate Tax   |
  |   4. Exit            |
  |                      |
  ========================
  
  Which would you like to do? 4
  You've chosen to quit.
  </code></pre>
  <p>I keep getting this error, but for all of the main methods:</p>
  <pre><code>Objective9Lab5.java:59: error: illegal start of expression
      public static double findSum(double x, double y) {
      ^
  </code></pre>