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
1. CMP and SUB CMP is used for comparing 2 registers by subtraction them from one another, but answer is not saved, whereas SUB subtracts 2 registers and saves the answer.

Write a program that accepts a date from the user in the form mm/dd/yyyy and then displays it in the form month dd, yyyy, where month is the name of the month. Enter a date (mm/d

Write 3 somewhat simple scripts / programs in any language, combination of languages, and/or software. Please tell me the task you are trying to accomplish in the scripts. Idea

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

Write three functions, statistics, average, and sD as follows. The statistics function returns no value and has six parameters: four scores followed by their average and standard d

Given grammar Grammar M following: 1 - - > begin end 2 - - > 3 - - > 4 - - > ? 5 - - > Id : = ; 6 - - > read ( ) ; 7 - - > write ( )

Implement the pull-down menu package

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

An apartment complex has several apartments to rent. The apartments are all similar, and all rent for $750 per month. Currently, all units are occupied. The management, being in bu

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4