Question: C++ programming assignement from chapter 1-5 0 -1 0.5 -0.75 1 -0.5 1.5 -0.25 2 0 C++ programming assignment x y 0.5 -1 1. -0.75

C++ programming assignement from chapter 1-5
0 -1
0.5 -0.75
1 -0.5
1.5 -0.25
2 0
 C++ programming assignement from chapter 1-5 0 -1 0.5 -0.75 1
C++ programming assignment
x y
0.5 -1
1. -0.75
1.5. -0.25
2. 0
-0.5 1.5 -0.25 2 0 C++ programming assignment x y 0.5 -1

rx)dx Area of a single trapezoid- You are to write a program that takes paired data representing x and y -fidl values measured in regular intervals on an irregular function from a user-specified input text file (must have .toxt file extension) and Problem Statement on for the definite integral from the first outting result using a user t -speified number of decimal consecutive data point without units. The number of data points in the file is not known in advance so the program retrieves data points until the end of file is reached. The p user multiple runs using different files without needing to restart the program places. The text file with the data is formatted so it provides x and associated y value for each needs to also offer the Specific program requirements are: 1. Explain to the user what the program does making sure the user is told how to provide the data 2. Ask the user how many decimalalages to show when data is provided on the console screen. in text files and where to save the file. Set up an outer loop that allows the user to repeat the remaining part of the program multiple d times using different data files 3. 4. Ask user for name of text file (code for this provided in lecture notes & appendix). s. Set up an orsanized table format (see sample output below) in preparation for pcioting out the 6. Set up a loop to execute the integration so that a or leop paired data from the file n the monitor for the use Each (x, y) data pair is printed to the console screen for the user with the user-specified number of decimal places a. b. Cakculate the area of each trapezoid using consecutive pairs of data. c. Add in the calculated area to a running total area. d. End loop when at the end of the data in the file 7. Report to the user on the console screen the approximation for the definite integral, agairn noting that units depend on the x and y axis units 8. Ask user if they want to perform calculation again with another data set. If no, end program. If yes, cycle back to step4 The data provided is for a straight line connecting the points (0,-1) and (5, 1.5) so the final answer using simple geometry is 1.25. Sample Data File Contents 0 -1 0.5.0.75 1 -0.5 1.5 -0.25 2 0 2.5 0.25 3 0.5 3.5 0-75 4.5 1.25 5 1.5 Sample output to user if user indicated to show three decimal places: approximation for the d efinite integral of fxh Area of a single trapezold A Uo)+r r(x)dx Problem Statement You are to write a program that takes paired data representing x and y -fix) values intervals on an irregular function from a us er-specified input text file (must have .txt file extension) and es an approximation for the definite integral from the first point to the last point using a outputting result using a user-specified number of decimal summation of tr places. The text file with the data is formatted so it provides x and associated y consecutive data point the program retrieves data points until the end of file is reached. The program n user multiple runs using different files without needing to restart the program. value for each without units. The number of data points in the file is not known in advance so needs to also offer the Specific program requirements are: 1. Explain to the user what the program does making sure the user is told how to provide the data in text files and where to save the file .Ask the user how many decimal places to show when data is provided on the console screen. 3. Set up an outer loop that allows the user to repeat the remaining part of the program multiple p times using different data files. 4. Ask user for name of text file (code for this provided in lecture notes & appendix). s Set up an orranized table format (see sample output below) in preparation fot.priating.out the 6. Set up a loop to execute the integration so that: afor leop paired data from the file on the monitor for the use. Each (x, y) data pair is printed to the console screen for the user with the user-specified number of decimal places a. b. c. d. Calculate the area of each trapezoid using consecutive pairs of data. Add in the calculated area to a running total area. End loop when at the end of the data in the file. Report to the user on the console screen the approximation for the definite integral, again noting that units depend on the x and y axis units. Ask user if they want to perform calculation again with another data set. If no, end program. If yes, cycle back to step4 7. 8. The data provided is for a straight line connecting the points (0,-1) and (5, 1.5) so the final answer using simple geometry is 1.25 Sample Data File Contents 0.5 -0.75 1 -0.5 1.5 -0.25 2 0 2.5 0.25 3 0.5 3.5 0.75 4.5 1.25 5 1.5 Sample output to user if user indicated to show three decimal places

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!