PDA

View Full Version : I need help trying to create a program?


Latimeradam
Jan 27, 2015, 01:53 PM
Hi

I am new to programming and I am struggling trying to create this program using the if solutions here is what I want to create
Produce a program that would calculate the perimeter of the triangle, the area of the triangle and the height of the triangle from the length of the three sides of a triangle. If the three lengths of the sides of the triangle do not define a valid triangle then the user must be notified of this and no calculation will be performed upon this data.


Required maths formula

Heron’s formula:

Area of triangle = SQRT(s(s-a)(s-b)(s-c))
where a, b, c are the three sides, s = (a + b + c)/2 and c is the base of the triangle

Height of the triangle = (Area of triangle)*2/c

Perimeter of triangle = a + b + c

Triangle types:

Scalene – all sides unequal
Isosceles – two sides only equal
Equilateral – all sides equal
Right Angled – one angle of 90 degrees

CravenMorhead
Jan 27, 2015, 03:23 PM
How is the triangle inputed into your program?

Latimeradam
Jan 28, 2015, 04:32 AM
visual basic C#

ScottGem
Jan 28, 2015, 05:58 AM
Either you are using VB or C# not both.

This appears to be a homework assignment. We won't do your work for you. Show us your code or the code not working and we will try to help.

CravenMorhead
Jan 28, 2015, 08:31 AM
I didn't ask what your tools were, I asked how they're being read in.

Latimeradam
Jan 29, 2015, 12:29 PM
I have got the codes but it seems to working in form not in console how could I convert it to console.