- Create a program that calculates and outputs the area of a triangle under two circumstances.
- The program will print the area out twice.
- For the first output:
- The triangle sides measure 3 and 4 at the beginning of the program.
- Integers variables will be used to hold the values of the length of the sides and the area of the triangle.
- Initially the area variable will hold a value of (be initialized to) zero.
- The program then calculates the area of the triangle and places the result of the calculation in the area variable.
- The value of the three variables holding the side lengths and area are to then be output as shown below.
- For the second output:
- Double variables are to be used to hold the values of the length of the sides and the area of the triangle.
- The side variables will be initialized to zero.
- The program then multiplies the integer length values by five and places them in the double type side variables.
- The program then calculates the area of the triangle using the new double type side values and places the result in the new double type area variable.
- The value of the double type variables holding the side lengths and area are to be output as shown below.
- The output should be with a single decimal place after the decimal point.
The program should produce the following output:
The sides of the triangle measure 3 and 4. The area is 6.
The sides of the triangle measure 15.0 and 20.0. The area is 150.0
Submit your completed assignment by following the directions linked below. Please check the Course Calendar for specific due dates.
Locate your NetBeans project folder and create a zipped copy of the folder. The zipped folder is to be a .zip type compressed file. This can be accomplished on all operating systems including Windows, Mac, and Linux. Rename the zip file as follows: your first initial and last name, followed by an underscore and the name of the assignment, and an underscore and the date. An example is shown below: