Then calculate the differences in the predicted and the recorded number of sunspots. These values are written to a file called pspots.dat. The predicted number of sunspots and the actual number of sunspots are read from files pspots.dat and ospots.dat, respectively. The difference in predicted and actual numberof sunspots are found for each year from 1850 to 1975 and written to a file called diffs.dat. Find the differences in the number of sunspots calculated by the equation and the actual number of recorded sunspots for the years 1850-1975.
Data files are particularly useful when large amounts of data are involved.
Each line of a data file is called a record . The OPEN statement assigns a number and a name to the file. The number 10 and the name ospots.dat is assigned to the file containing the yearly number of observed sunspots. Do not assign the numbers 5 or 6 to a data file. The OPEN statement may also contain other specifications that are optional but useful in some cases.