Write a Java program for calculating the area of triangles and rectangles. The user is asked whether a triangle or rectangle is required, then prompted for the relevant dimensions, and the answer is displayed. Use the Wages program as a template. Note that the area of a rectangle is width * height, and the area of a triangle is base width * height. Ensure your program works correctly for different user inputs.