Jump to page: 1 2
Thread overview
111
Feb 19, 2016
Lisa
Feb 20, 2016
cym13
Feb 20, 2016
Lisa
Feb 20, 2016
Chris Wright
Feb 20, 2016
Lisa
Feb 20, 2016
Chris Wright
Feb 20, 2016
Adam D. Ruppe
Feb 20, 2016
cym13
Feb 20, 2016
Ivan Kazmenko
Feb 20, 2016
Ali Çehreli
Feb 20, 2016
Lisa
Feb 20, 2016
Lisa
Feb 20, 2016
Ali Çehreli
Feb 20, 2016
Lisa
Feb 20, 2016
Ivan Kazmenko
Feb 21, 2016
Lisa
Feb 21, 2016
Ivan Kazmenko
Feb 21, 2016
Lisa
Feb 20, 2016
Lisa
February 19, 2016
Can you please help me and explain how to create a program, which would find area of triangle and its perimeter?

February 20, 2016
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?
February 20, 2016
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
February 20, 2016
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?
February 20, 2016
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.
February 20, 2016
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?

First, one can't find these unless something is given.  So, what is given: sides? angles? two-dimensional coordinates?

The next stop is Google for how to do that mathematically, without touching the keyboard.

Once you have the above, you may have some specific difficulty expressing that in a programming language of your choice, one which Google (again) can't resolve in a few minutes.  If that is the case, please state that difficulty.

February 20, 2016
On Saturday, 20 February 2016 at 00:04:04 UTC, 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

I don't think you'll ever get the program listing here, it's just not how it works. We can help you, guide you to the solution but you are the one that has to do it otherwise it defeats the whole purpose of the exercise.

First of all, programming is explaining a solution to a really dumb student (the computer). If you can't do it by hand, you can't explain it to the computer. Once you can do it by hand, decompose each step into steps as simple as possible and write them down on paper. Then it's just a matter of translating your pseudo-code on paper to real code: if it's an exercise I'm sure you have had courses and examples. Take inspiration, try things and don't hesitate to fail: nobody expects you to get it right on the first time.
February 20, 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.
February 20, 2016
On Saturday, 20 February 2016 at 00:42:36 UTC, Chris Wright wrote:
> How do you calculate the area of a triangle? Same way as you'd do it by hand -- 1/2 base times height.

Getting the height can be tricky sometimes though, depending on what information you know about the triangle.

I like to check wikipedia for refreshers on math tricks.

https://en.wikipedia.org/wiki/Triangle#Computing_the_area_of_a_triangle

There's formulas to follow for almost any kind of input there... and if you have to get perimeter anyway, you are already calculating the lengths of the sides, so I'd use the convenient formula in there based on those very lengths!
February 19, 2016
On 02/19/2016 03:56 PM, Lisa wrote:
> Can you please help me and explain how to create a program, which would
> find area of triangle and its perimeter?

It's great to have student questions on this forum. If you don't mind telling us, which teacher and school teaches or uses D? The only one that I know of is Professor Chuck Allison at Utah Valley University.

Assuming that you are given the lengths of the three sides, you can calculate the area with Heron's formula. I had used that method in this otherwise unrelated chapter:

  http://ddili.org/ders/d.en/invariant.html

Ali

« First   ‹ Prev
1 2