Question: Implement a number counting program. Your program will consist of two different functions, Write into File Read from File Write into File will take input
Implement a number counting program. Your program will consist of two different functions, Write into File Read from File Write into File will take input from the user (as long as the user doesnt enter -1) and will keep on writing this data into a file named Numbers.txt. Input from the user will be a number from 0-9 and no other input will be accepted (display error if another input is given by the user). Read from File will read the data from Numbers.txt and then count the occurrence of every digit in the file and write it into another text file named Count_Frequency.txt. For example, if the file contains the following data, Then the following will be written into the Count_Frequency.txt file, Count of 0: 2 Count of 1: 2 Count of 2: 2 Count of 3: 2 Count of 4: 0 Count of 5: 2 Count of 6: 2 Count of 7: 0 Count of 8: 1 Count of 9: 2 1 2 0 3 0 5 1 6 9 8 9 6 2 3 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
