Question: Problem 2: Reading Numbers from File (40 points) A le Numbers.txt (given below) contains an unknown number of both negative and positive integers. Numbers.txt (click

 Problem 2: Reading Numbers from File (40 points) A le Numbers.txt

Problem 2: Reading Numbers from File (40 points) A le Numbers.txt (given below) contains an unknown number of both negative and positive integers. Numbers.txt (click to download) E Create a program proj2_2.cpp that reads the numbers from the file, counts and sums all negative numbers and separately all positive numbers (zero is considered positive). Your program should display the final count and sum for these numbers. All these values can and should be computed within one reading pass through the file. Sample run (not for the given file): Processing fileplease wait Negative count: 12 Negative sum: -231 Positive count:9 Positive sum: 145 Hint: follow examples on pages 298, 299 for file processing. Pay close attention to file open errors

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!