Program to calculate the triangle area, Programming Languages

Write a program that will allow the user to input the corners of a triangle. The program will draw small yellow circles for each input point, then draw the triangle and calculate the perimeter and area of the triangle. The program will also draw the "mirror image" of the triangle, formed by swapping the x and y coordinates of each point. This is sometimes called the "reflection" of an object.

These actions will then be repeated 4 more times for triangles in different colors.

The equation for the perimeter is length of each of the three sides added together. Use the distance formula from Program 1 (it was used for finding the radius there).

The area of a triangle can be calculated using these equations (a, b and c are the lengths of the three sides of the triangle):

665_area.png

The program should report the perimeter and area of each triangle and its reflection. It should also keep a total of each of those 2 measures and report the total when the program is about to end. The totals should include all triangles, including reflections. Note that the output samples also show a counter "Triangle 1", "Triangle 2", etc.

The list of colors it should use for triangles is ["red", "blue", "green", "pink", "black"].

Posted Date: 3/22/2013 3:38:45 AM | Location : United States







Related Discussions:- Program to calculate the triangle area, Assignment Help, Ask Question on Program to calculate the triangle area, Get Answer, Expert's Help, Program to calculate the triangle area Discussions

Write discussion on Program to calculate the triangle area
Your posts are moderated
Related Questions
The idea of this section is not to do anything new along with a series solution problem.  Instead this is here to exemplify that moving in a higher order differential equation does

Does anyone know anything about java programming here?

System.in and System.out should not be used anywhere in the programs except in main and only for testing purposes.  All calculations should be done in a method.  Note:  To use J

i need a coding to glow 8 LEDs on a port with pwm effect

You must use the keyword ''var'' to create and initialize a variable. The placement of the variable creation in your code is very important. Examples: var first = 21; var secon


You are to write a program which will answer a pair of questions for squares, triangles, circles and ellipses. A square is defined by its lower left corner (SLLx,SLLy), and the len

Implement the "Nuclear Reactor" example using the following:  An ISR triggered by a button press  A task to update the temperatures  A semaphore to communicate between the ISR and

A non-empty string β is called a repeat pre x of a string s if ββ is a pre x of s. Give a linear time algorithm to find the longest repeat prefix of s. Hint: Think of using lca

.NET Windows Services But Enthusiasm has an amazing record of beginning overdue but finding up easily. This is real in situation of .NET too. Enthusiasm put their best men at