# Daily Challenge #63

Hello guys, today’s daily challenge is again from me.

Today’s one will be too easy when you know what to do.

We will (again) travel a bit to the past, but today, we are going to go to old Greece. Imagine you’re in this time, when Democracy is invented and the old men of science discovered the earliest formulas, that are still used today, in this device that you are certainly staring at.

one of the main issues was, to invent a formula for a triangle’s surface. This was really needed because of farmers dividing their land to their sons who wanted the same each or to calculate another thing. (Idk what else actually, I had no more ideas.)

So actually, today’s challenge will be, to make a procedure that, if three sides of a triangle are given (and nothing else), returns the surface.

Tip: You will have to know Heron.

Heron-joke

PS: If you don’t know Heron, then

1. You were the one and only one, who skipped school for koding apps while Math lessons were ongoing
2. Your teacher was the fake Einstein, who saw “Heron” at the blackboard as the topic for today and thought “Hmmmm. Never heard of him. And immediately began an English conjugation lesson with the conjugation topic “He won” as the conjugation topic (in the upcoming math test, you would be wrong because in a question about Heron, instead on Heron,(which was not discussed in your Heron lesson, but a “He won” lesson on the place of Heron.) you would write “He won” bc you don’t know who Heron is)

However, both situations are excusable. So, if you were in one of those situations (or both), you will have to check who’s Heron first.

Haaaaappy koding!

1 Like

Sorry I am unable to understand your question.
It should return perimeter or area.

Better known as area.

Then probably this one is a solution:

Edit: Corrected my mistake.Thanks to @Vaibhav

1 Like

Yes. Great to see the first one. But please hide it, so others who don’t want to, doesn’t have to see it.

1 Like

Wait. Your result is NOT 6, what it should be. where do you something wrong? For 3, 4, 5 it should be 6!

Are you sure?
You don’t think you are missing square root or under-root.

No. The area of a triangle with 3, 4 and 5 should be 6.

you believe me now?

Here is the improvisation over @vknow360’s blocks. He forgot to multiply with sP variable

Solution

2 Likes

Yes, you are right, @Vaibhav! very good!

1 Like

But, please, @Vaibhav, can you hide your solution, too? I don’t want someone spoils.
Thank you.

1 Like

I woke up to late for this. But it’s very easy indeed.

Proud to be Greek.

4 Likes

1 Like

I do not get it. The surface of a triangle is calculated as (base x height) divided by 2, forget the heron formula

So in this example b is height since its right triangle then assuming b=5 and a = 4 then the surface is (4x5)/2=10 and with code is approximately 10 (9.92157) . So why does your procedure returns 6 as surface area ?
See mine

The hypotenuse is the longest side, opposite to the right-angled vertex. Therefore area of a triangle with sides 3,4,5 is:
½×4×3 = 6

2 Likes

Got it , I mistaken the number as 4,5,6 instead of 3,4,5

2 Likes

Is there lockdown in your country also?
If yes then this can be called an side-effect of lockdown.
We are forgetting basic math

2 Likes

I didn’t forget basic maths I just misread the numbers instead of 3,4,5 I saw 4,5,6 And yes in Greece we still have lockdown. From Monday some shops and public services will start again

2 Likes

Sorry…that was for me

My district has been placed in Green Zone so it is expected that we will get some concession in Lockdown since Monday.
I hope same for you and everyone.

Btw , I would like to say thank you to @Yoshi for this easy but tricky daily challenge.
Is it expected to see more daily challenges on math?

2 Likes

Yes. I love maths. (When I can understand it (happens to ca. 5% of all math questions and problems))

2 Likes