Question: (21 points) Create a data file (using Notepad, perhaps) containing the values shown below (plus add 4 more lines of your choice) and then write

(21 points) Create a data file (using Notepad, perhaps) containing the values shown below (plus add 4 more lines of your choice) and then write a C++ program as follows:

Read the data file (you can assume that it has exactly 8 lines with 3 numbers per line)

Calculate the three angles using the law of cosines (assume that the sides are valid)

Write the results to an output data file. The results should include headings and 2 digits after the decimal point for all values. An example is shown below.

Print the program and the two data files. Input data file: Output data file: ?

Input data file:

20 15 10

5 12 13

10 10 14.142

50 60 70

output data file:

sideA sideB sideC angleA(deg) angleB(deg) angleC(deg)

20.00 15.00 10.00 104.48 46.57 28.96

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 Databases Questions!