Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i have an assignment in which i have to write a program which uses Herons formula to caculate the area of a triangle in C++.

i have an assignment in which i have to write a program which uses Herons formula to caculate the area of a triangle in C++. Below is the code i have so far. I am not sure what is wrong with it, there are no errors, but when i input the numbers, i get an incorrect area for my output. Is anyone able to point me in the right direction of where I went wrong?
image text in transcribed
include Kiostream> Sinelude using namespace std; int main() NONEN int sidel, side2, side3; float area, perimeter: cout > side2 >> side3 perimeter - (sideltside2+side)/2; area sqrt((perimeter) (perimeter-side1)(perimeter-side2) - (perimeter-side)); cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

x+2 If [2x-3 is symmetric, then X = -3 x+1_ (a) 3 (b) 5 (c) 2 (d) 4

Answered: 1 week ago

Question

6. Discuss the steps involved in conducting a task analysis.

Answered: 1 week ago

Question

8. Explain competency models and the process used to develop them.

Answered: 1 week ago