//My question is how can I make the program repeat until the user enters the number 4 to exit?
/** * Write an application for a furniture company; the program determines the price of a table. Ask the user to choose 1 for pine, 2 for oak, or 3 for mahogany. The output is the name of the wood chosen as well as the price of the table. Pine table cost $100, oak tables cost $225, and mahogany table cost $310. Also ask the user to specify a (1) large table or a (2) small table. Add $35 to the price of any large table and add nothing to the price for a small table. Display the output. Your program must repeat until the user chooses to exit. */ import java.util.Scanner; public class Wood { public static void main(String[] args) { Scanner input = new Scanner (System.in); System.out.println ("Table Prices"); System.out.println ("Choose 1 for Pine"); System.out.println ("Choose 2 for Oak"); System.out.println ("Choose 3 for Mahogany"); System.out.println ("Choose 4 to Exit"); int userNumber = input.nextInt(); System.out.println ("Enter 5: Small table or Enter 6: Large table"); int tableNumber = input.nextInt(); if ( userNumber == 1 && tableNumber == 5) { System.out.println ("You selected the following table:"); System.out.println ("Wood: Pine"); System.out.println ("Size: Small"); System.out.println ("Price: $100"); } if ( userNumber == 1 && tableNumber == 6) { System.out.println ("You selected the following table:"); System.out.println ("Wood: Pine"); System.out.println ("Size: Large"); System.out.println ("Price: $135"); } if ( userNumber == 2 && tableNumber == 5) { System.out.println ("You selected the following table:"); System.out.println ("Wood: Oak"); System.out.println ("Size: Small"); System.out.println ("Price: $225"); } if ( userNumber == 2 && tableNumber == 6) { System.out.println ("You selected the following table:"); System.out.println ("Wood: Oak"); System.out.println ("Size: Large"); System.out.println ("Price: $260"); } if ( userNumber == 3 && tableNumber == 5) { System.out.println ("You selected the following table:"); System.out.println ("Wood: Mahogany"); System.out.println ("Size: Small"); System.out.println ("Price: $310"); } if ( userNumber == 2 && tableNumber == 6) { System.out.println ("You selected the following table:"); System.out.println ("Wood: Mahogany"); System.out.println ("Size: Large"); System.out.println ("Price: $345"); } } }