Question: Programming Challenge # 1 6 : Create a C + + program with two functions: main ( ) and Triangle ( ) . The program

Programming Challenge #16:
Create a C++ program with two functions: main() and Triangle().
The program must read data from a text file.
The data must be in a matrix format with 6 columns and an initially unknown number of rows.
Each row of data defines a triangle on the xY plane, where the first two numbers are the x1 and Y1 coordinates of one vertex of the triangle, then x2 and Y2 of another vertex, and then x3 and Y3 of a third.
The program must read this data and display all given triangles on the graphics screen.
Demonstrate the functionality of the program with two sets of example data:
A file whose data defines 4 triangles inside one big, as in the picture:
A file whose data defines a 4-point star, as in the picture:
Show the output to your instructor to check the performance of the program. Explain how you split the functionality of the program between the two functions. This means that you need to explain what the Triangle() and main() functions do in your program?
Programming Challenge # 1 6 : Create a C + +

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!