111

Chris Wright via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Feb 19 16:42:36 PST 2016


On Sat, 20 Feb 2016 00:17:28 +0000, Lisa wrote:

> On Saturday, 20 February 2016 at 00:15:16 UTC, Chris Wright wrote:
>> On Sat, 20 Feb 2016 00:04:04 +0000, Lisa wrote:
>>
>>> On Saturday, 20 February 2016 at 00:01:47 UTC, cym13 wrote:
>>>> On Friday, 19 February 2016 at 23:56:29 UTC, Lisa wrote:
>>>>> Can you please help me and explain how to create a program,
>>>>> which would find area of triangle and its perimeter?
>>>>
>>>> What do you need help for exactly? What have you tried? What do you
>>>> struggle with?
>>> 
>>> With everything, actually i need full explanation and listing of
>>> programm from its beginning
>>
>> Is this a homework problem that was assigned to you?
> 
> Yes, exectly. It's new for me, and i don't even know how should I start.

Break the problem down into parts.

First you need to get a triangle. Then you need to calculate the 
dimensions.

How do you get the triangle? The homework problem should tell you.

How do you calculate the area of a triangle? Same way as you'd do it by 
hand -- 1/2 base times height. Break that down further and further and 
you'll have that part squared away before long.

How do you calculate the perimeter of a triangle? Same way as you'd do by 
hand -- sum of distances between corners. Again, break it into parts and 
you'll have a program before long.

Programmers tend to be reluctant to do other people's homework for them. 
(People in general are reluctant to do other people's homework for them.) 
It would help you this week, but you'd be further out of your depth next 
week and you'd be pretty much bound to fail. Or you'd have a lot more 
work to catch up and a lot less time in which to do it.


More information about the Digitalmars-d-learn mailing list