Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ code Read three sides (S1, S2 and S3) of a triangle from input file Data.txt to check if the triangle is an equal triangle

C++ code image text in transcribed
Read three sides (S1, S2 and S3) of a triangle from input file "Data.txt" to check if the triangle is an equal triangle or not. There will be three cases according sides values: Equal triangle if all sides are equal. Then compute the perimeter (P) and area (A) of triangle. P = S1 + S2 + S3 A = Squareroot (P/2)(P/2 - S1)(P/2 - S2)(P/2 - S3) Not equal triangle if sides are not equal. Then compute the perimeter and area of triangle as shown above. Not triangle if one side or more, is less than or equal zero. Then skip the iteration to read next triangle sides. Write boolean function isEqTri which returns either true if the triangle is equal or false if not. The three sides should be passed by values to the function. Write void function calTri to calculate the area and perimeter of triangle. This function will have five parameters: three sides by values and, area and perimeter by reference. main function should call above functions and use input file to produce an output file as shown below. The program should ask the user for the name of output file. Your solution must: i. Contain all necessary comments (including your ID and name on the top; -5% if not included) ii. Use proper naming style and line indentation iii. The output must be properly aligned as in the sample output (use 2 decimal place for all floating numbers) iv. Submit to Moodle the C++ program (named LT2A_99999.cpp)

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

Hands On Database

Authors: Steve Conger

1st Edition

013610827X, 978-0136108276

More Books

Students also viewed these Databases questions

Question

Describe the Indian constitution and political system.

Answered: 1 week ago

Question

Explain in detail the developing and developed economy of India

Answered: 1 week ago

Question

Problem: Evaluate the integral: I = X 52+7 - 1)(x+2) dx

Answered: 1 week ago

Question

What is gravity?

Answered: 1 week ago

Question

What is the Big Bang Theory?

Answered: 1 week ago

Question

=+ What typical employee will the IA compare him/

Answered: 1 week ago

Question

=+7 What is the overall cost of the international assignment?

Answered: 1 week ago