Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 4 (25 Bonus Marks) The area of a triangle (whose sides have lengths a, b and c) can be calculated using Heron's formula as

image text in transcribed
Task 4 (25 Bonus Marks) The area of a triangle (whose sides have lengths a, b and c) can be calculated using Heron's formula as shown in Eqs. (2) and (3). (5 Marks) Write a C++ function that calculates the area of a triangle using Heron's formula. (10 Marks) Use the function in a program that prompts the user for the lengths of the sides of a triangle and displays the area of the triangle. a. b. After displaying the value, the program should indefinitely go back to prompt for the lengths of sides of the next triangle then recalculate and display the area. a. b. The program should quit when the user enters a negative number. c. The prompt of the program should inform the user as to how to quit it (by entering c. (15 Bonus Marks) Modify the program in b. so that it takes the x, y and z coordinates as user input and then computes the lengths of the triangle's sides before computing the area. a negative number for a length of the triangle's side HINT: include Area, A- s(s -a)(s -b)(s -c) a+b+c

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

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

ISBN: 0805302441, 978-0805302448

More Books

Students also viewed these Databases questions

Question

3.5

Answered: 1 week ago

Question

Create a Fishbone diagram with the problem being coal "mine safety

Answered: 1 week ago

Question

here) and other areas you consider relevant.

Answered: 1 week ago