Create a data file in the specified format write a script


A file floatnums.dat has been created for use in an experiment. However, it contains float(real) numbers and what is desired instead is integers. Also, the file is not exactly in the correct format; the values are stored columnwise rather than rowwise. For example, if the file contains the following:

 

90.5792      27.8498     97.0593

12.6987      54.6882     95.7167

91.3376      95.7507     48.5376

63.2359      96.4889     80.0280

9.7540         15.7613     14.1886

 

what is really desired is:

 

91      13      91     63      10

28      55       96    96       16

97      96       49    80       14

 

Create a data file in the specified format. Write a script that would read from the file floatnums.dat into a matrix, round the numbers, and write the matrix in the desired format to a new file called "intnums.dat."

 

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Create a data file in the specified format write a script
Reference No:- TGS0647158

Expected delivery within 24 Hours