Question: This is a C++ Problem: Resistors-R-Us.dat file: 35 8 3.3884 3.1033 3.2681 3.2889 3.0943 3.3539 3.3666 3.2853 3.2437 3.0874 3.3767 3.1344 3.4415 3.3411 3.3713 3.3217
This is a C++ Problem:




Resistors-R-Us.dat file:
35 8 3.3884 3.1033 3.2681 3.2889 3.0943 3.3539 3.3666 3.2853 3.2437 3.0874 3.3767 3.1344 3.4415 3.3411 3.3713 3.3217 3.2949 3.0535 3.2249 3.2540 3.3110 3.2260 3.2986 3.1195 3.2137 3.5105 3.2295 3.2049 3.1852 3.2681 3.3526 3.1494 3.1479 3.3472 3.0298 3.2609 3.5117 3.2744 3.3371 3.3291 2.9427 3.2757 3.1725 3.2249 3.3051 3.2596 3.2118 3.2383 3.3126 3.1526 3.1107 3.2310 3.2794 3.1670 3.2929 3.3053 3.2213 3.1354 3.2114 3.1467 3.1722 3.2148 3.2201 3.1539 3.2303 3.3048 3.3026 3.2177 3.1435 3.2325 3.1600 3.0866 3.2906 3.4065 3.4023 3.3267 3.0732 3.2019 3.3135 3.3261 3.1081 3.0807 3.4298 3.4245 3.2077 3.3337 3.2567 3.3693 3.1771 3.2051 3.2383 3.1339 3.1447 3.5038 3.2313 3.4132 3.3647 3.2416 3.2180 3.4877 3.3148 3.1177 3.2792 3.0968 3.3098 3.0508 3.3318 3.4026 3.2182 3.2628 3.3488 3.1163 3.1219 3.3341 3.2990 3.2669 3.4269 3.1058 3.2893 3.1026 3.0297 3.2085 3.3265 3.2199 3.4011 3.3803 3.2695 3.2458 3.1929 3.4412 3.3278 3.1801 3.2664 3.3910 3.2780 3.1884 3.2714 3.2109 3.1020 3.3333 3.2217 3.0837 3.2551 3.3814 3.3442 3.2909 3.3040 3.1805 3.3652 3.4444 3.1726 3.1045 3.2594 3.1358 3.2408 3.2038 3.1353 3.1415 3.3287 3.0758 3.1378 3.1875 3.1740 3.3384 3.3174 3.2727 3.3909 3.2705 3.2806 3.1331 3.1806 3.2936 3.1831 3.3599 3.1966 3.3693 3.1328 3.2893 3.3781 3.3397 3.2100 3.2647 3.4428 3.1697 3.1539 3.3802 3.1690 3.3005 3.1828 3.4796 3.2324 3.1234 3.1846 3.1906 3.1263 3.2099 3.3076 3.5253 3.2256 3.2351 3.1271 3.2936 3.2715 3.1986 3.1722 3.2638 3.1602 3.0864 3.2229 3.1996 3.4511 3.3296 3.1436 3.0593 3.1708 3.2517 3.1600 3.2602 3.2526 3.1829 3.3053 3.2135 3.1547 3.3328 3.2214 3.3696 3.2808 3.3687 3.2077 3.1652 3.2854 3.2718 3.2038 3.2620 3.1562 3.3291 3.2862 3.1735 3.4097 3.0591 3.2090 3.1463 3.4174 3.2788 3.2148 3.1372 3.3027 3.1963 3.1996 3.1643 3.2625 3.2503 3.2770 3.2578 3.3354 3.2198 3.3733 3.2330 3.3030 3.2866 2.9936 3.4607 3.3842 3.4314 3.3110 3.2308 3.1548 3.6027 3.2966 3.1784 3.0000 3.3415 3.2559 3.1634 3.3354 3.2388 3.4354 3.2219 3.2332 3.2443
C++
Goals: Developing problem-solving skills, using functions and arrays Problem: You have been asked to use your programming skills to help analyze data from a company name "Resistors-R-Us". This company has different locations producing resistors with different formulas. They have automated the data collection so that the resistances 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 company location. Your program should have a main function and 4 other functions as described below. The company has stated that there will not be more than 80 formulations and not more than 10 locations using the same formulations. One function should open the file "Resistors-R-Us.dat" and read the first line that contains the number of formulations (the first value) and number of locations (the second value) using those formulations. Using these two values, your function should then read the rest of the data and store the values in a 2-dimensional array with formulations in rows and the locations in columns. As the resistances are being stored, a message should be output if any resistance is not in the range of 3 to 3.5 inclusive and the number of resistances not in the range should be counted. The message should output the resistance, the location and the formulation as the example below. The value of 2.9427 ohms from location 1 for formulation 6 is suspect The resistance should still be stored in the array. The 2-dimensional array, the number of formulations and the number locations should be sent back to the function call. The number of resistances not in the range of 3 ohms to 3.5 ohms inclusive should be returned to the function call Goals: Developing problem-solving skills, using functions and arrays Problem: You have been asked to use your programming skills to help analyze data from a company name "Resistors-R-Us". This company has different locations producing resistors with different formulas. They have automated the data collection so that the resistances 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 company location. Your program should have a main function and 4 other functions as described below. The company has stated that there will not be more than 80 formulations and not more than 10 locations using the same formulations. One function should open the file "Resistors-R-Us.dat" and read the first line that contains the number of formulations (the first value) and number of locations (the second value) using those formulations. Using these two values, your function should then read the rest of the data and store the values in a 2-dimensional array with formulations in rows and the locations in columns. As the resistances are being stored, a message should be output if any resistance is not in the range of 3 to 3.5 inclusive and the number of resistances not in the range should be counted. The message should output the resistance, the location and the formulation as the example below. The value of 2.9427 ohms from location 1 for formulation 6 is suspect The resistance should still be stored in the array. The 2-dimensional array, the number of formulations and the number locations should be sent back to the function call. The number of resistances not in the range of 3 ohms to 3.5 ohms inclusive should be returned to the function call
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
