Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ don't answer if you can't handle it Goals: Developing problem-solving skills, using functions and arrays Problem: The company, HeatTransfer, has expanded its study to

C++ don't answer if you can't handle it

Goals: Developing problem-solving skills, using functions and arrays Problem: The company, HeatTransfer, has expanded its study to include more formulations and plants. They have automated the data collection so that the thermal conductivities are stored in a file containing a table (2-D array). Each row of the table represents a specific formulation and each column represents a specific plant. Your program should have a main function and 4 other functions as described below. The manufacturer has stated that there will not be more than 50 formulations and not more than 12 plants.

One function should open the file thermalconduct.dat and read the first line that contains the number of formulations (the first value) and number of plants (the second value). Using these values, your function should then read the rest of the data and store the values in a 2-dimensional array. As the thermal conductivities are being stored, a message should be output if any thermal conductivity is not in the range of 3 to 10. The message should output the formulation, plant and thermal conductivity as the example below. The value of 14.56 from plant 1 for formulation 8 is suspect. The thermal conductivity should still be stored in the array. The number of formulations and number plants should be sent back to the function call

One function should accept the 2-dimensional array, the number of formulations and number of plants then create a 1-dimensional array containing the minimum thermal conductivities for each formulation and create a 1-dimensional array containing the maximum thermal conductivities for each formulation. This function should call the function to output a 1-dimensional array for the minimum and maximum values before sending these arrays back to the function call.

One function should accept the 2-dimensional array and determine the average thermal conductivity for each formulation. The average thermal conductivity for each formulation should be calculated without including the maximum and minimum thermal conductivity for that formulation, therefore this function will need to call the function that calculates the minimum and maximum thermal conductivities for each formulation. The average thermal conductivities for the formulations should be stored in another 1-dimensional array which is sent back to the function call.

One function that will accept a 1-dimensional array, the number of values stored in the array and a description of what is stored in the array, e.g minimum thermal conductivity for each formulation, average thermal conductivity for each formulation, etc. The function will then output the description and the values. The values should be output to 4 significant digits; Programming Project 4 2 CMPSC 201 Fall 2017

The main function should prompt the user to enter the filename for the data file and call the function to import the data from the file into a 2-dimensional file. Next main should call the function to calculate the averages of the formulations. The main function should then call the function to output a 1-dimensional array sending the array of averages to the function to calculate the 1-dimensional array. A data file, thermalconduct.dat, has been posted on CANVAS. However, you should create your own file with fewer formulations and plants to test your code.

Make sure that you have comments immediately before each function that describe the purpose of the function, the input needed by the function (what is passed to the function and what the user is prompted to enter within the function), the output expected from the function (what is sent back to the function call and what is output to the screen) by the function, and processing needed by the function.

thernmal conduct dat

image text in transcribed

image text in transcribed

31 9 7.52 6.3 5.56 9.80 9.90 6.83 5.26 7.33 5.48 8.31 5.86 .42 7.97 8.96 .0 .88 4.02 .92 9.33 9.33 8.35 9.21 4.94 5.56 7.14 9.14 5.95 8.8e 8.13 5.47 e.15 5.6 8.45 8.15 5.98 7.86 9.66 6.92 7.6 7.65 5.24 3.78 5.75 7.5 342 5.91 7.67 9.59 4.97 7.60 9.72 3.13 492 9.31 5.76 7.64 4.91 4.55 7.98 6.36 7.94 6.46 7.12 9.08 7.62 6.18

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

AutoCAD Database Connectivity

Authors: Scott McFarlane

1st Edition

0766816400, 978-0766816404

More Books

Students also viewed these Databases questions

Question

=+What is the procedure for labor relations in the workplace?

Answered: 1 week ago

Question

=+ Are ballots compulsory?

Answered: 1 week ago