Question: Please answer PROBLEM 2 ONLY, using C++ code. The data.txt file is pasted below: [253, 676, 114] [527, 160, 277] [364, 193, 169] [246, 651,

 Please answer PROBLEM 2 ONLY, using C++ code. The data.txt file

Please answer PROBLEM 2 ONLY, using C++ code. The data.txt file is pasted below:

[253, 676, 114] [527, 160, 277] [364, 193, 169] [246, 651, 378] [536, 479, 695] [569, 548, 83] [117, 387, 543] [294, 753, 702] [651, 296, 284] [600, 498, 114] [201, 260, 629] [686, 473, 375] [234, 727, 89] [447, 83, 730] [521, 591, 300] [279, 405, 227] [686, 101, 448] [559, 602, 283] [75, 137, 170] [430, 136, 527] [111, 259, 219] [280, 217, 707] [433, 437, 194] [165, 359, 643] [398, 463, 614] [352, 511, 242] [413, 306, 751] [443, 281, 540] [81, 362, 548] [407, 706, 513] [150, 632, 367] [616, 575, 393] [701, 172, 545] [311, 207, 284] [210, 659, 535] [355, 587, 583] [151, 461, 79] [742, 484, 279] [695, 127, 91] [699, 88, 550] [653, 80, 346] [493, 573, 105] [529, 345, 372] [393, 530, 164] [756, 627, 735] [476, 384, 433] [706, 300, 577] [378, 591, 402] [206, 161, 523] [709, 254, 588] [393, 256, 230] [344, 673, 676] [725, 463, 227] [522, 719, 636] [594, 124, 460] [397, 641, 487] [520, 316, 512] [92, 665, 399]

MCS 360 Project 2: Working with File, Vector and String Data Types in C++ Project 2 Description. The goal of this project is to familiarize ourselves with file and string data types in C++. As a source of data in this project you will use the file data.txt. Download it, along side the project description, from Blackboard. This file contains 3 integers per line, separated by a comma. Each such line of integers is enclosed inside square brackets. See the file for more details. Your complete project will include a single main function, in which you call functions problem1() and problem2(), where each such function solves the problem with the same name. Solve each problem in order they are listed below. The two functions problem1() and problem2() can either be defined/located above the main function of below it. Your main function must look like this int main() { string s = "data.txt"; problemi(s); problem2(s); return 0; } Problems Problem 1. Write a function, called problem1() which takes a file name, ie. data.txt, on input. The func- tion reads the data contained in the file and prints to screen the average value of all integers contained in the file. Note, not just per line but all integers in the file. [25 Points) Problem 2. Write a function, called problem20) which takes a file name, ie. data.txt, on input. The function reads the data contained in the file and prints to screen two integer values, separated by a comma, denoting the smallest integer in the data file and the largest integer in the data file. [25 Points]

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!