Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Question Work in groups of two or three students. This lab will support the same input as in Lab #2. You will implement a

C++ Question

image text in transcribed

Work in groups of two or three students. This lab will support the same input as in Lab #2. You will implement a Triangle class according to the header file as given. // Triangle.h #Ifndef TRIANGLE H #de fine TRIANGLE H class Triangle i public Triangle (float base, float height); float area ) private: float base float height_i #endif /* TRIANGLE H */ Write a program that reads from a data file named triangles.dat in the same directory as your program's current working directory (i.e. no need to specify path to the file) that contains unknown pairs of base and height values of triangles. Use the Triangle objects created from the class above to compute the area. Again, you may use the following values in your data file or you can create your own. cat triangles.dat 15.0 4.0 6.0 9. 3.0 4. 5.23 8.45 52.36 84.78 The area of triangle is calculated with this formula Area-baseheight Expected output format s ./lab03 Triangle 1: Triangle 2: Triangle 3: Triangle 4 : Triangle 5: b-15, h-4, area-30 b-6, h-9, area-27 b=3, h=4, area-6 b=5. 23, h=8 . 45, area-22. 0968 b=52.36, h=84.78, area=2219.54

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_2

Step: 3

blur-text-image_3

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

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions