English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

write a program (in C++) to do the following tasks?
1) accept the coordinates of 3 points.

2) check whether these points form a triangle or not.

3)if the given 3 points form a triangle find its area.

4) you should write a function that calculate the distance between 2 points and calculate the slope of the line connects these 2 points.

5) write a function to find the area of a triangle using the formula:
sqrt( S(S-A)(S-B)(S-C) )
where A,B,C are the triangle sides and S=(A+B+C)/2 ( half of the circumference)
=========================
plz plz plz help me to do it [-o< THX Alot....

2006-11-25 03:12:33 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

3 answers

Let me give a try I am only a begineer and I am in the 10 grade so here it goes. I am not going to write it just going to tell you wat to do in the main();.

What we know about a triangle I don;t know how to prove wheater it is a triangle or not. Try a^2+b^2 =c^2 by using the distance formula.

area of triangle = (base * hieght)2
the base could be any side first figure out which 1 then use the distance formula go here for it http://www.purplemath.com/modules/distform.htm.

2006-11-25 03:24:28 · answer #1 · answered by Best Helper 4 · 0 0

Of three points, A,B,C
Check the slope of A-B, B-C, A-C. If any of the slopes are the same, you have parallel lines and thus no triangle. So, to do (2), do (4) first.
If you know the distance between A-B, B-C, A-C, you can calculate the area with the formula, so (5) also depends on (4).

You write your own code. yA isn't a site to do your homework, since if you don't do it yourself, you don't pass the class!

2006-11-26 03:55:56 · answer #2 · answered by a7med_h_87 1 · 0 0

no thank u i dont like to waste my time doing someone else's work no srry i just don't know how to do C++ but my older sister can do it

2006-11-25 03:24:55 · answer #3 · answered by Anonymous · 0 0

fedest.com, questions and answers