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:
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here