Write a program that creates the following three files; dataplus.txt dataminus.txt zeros.txt The program should read each line of the data.txt file and perform the following; If the line contains a...


Write a program that creates the following three files;


dataplus.txt


dataminus.txt


zeros.txt


The program should read each line of the data.txt file and perform the following;


If the line contains a positive number, that number should be written to the dataplus.txt file


If the line contains a negative number, that number should be written to the dataminus.txt file


If the line contains the value 0, do not write the value to a file. Instead, keep a count of the number of times 0 is read from the data.txt file


After all the lines have been read from the data.txt file, the program should write the count of zeros to the zeros.txt file.


The code is below does not work:




Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here