subject

For this lab, you are going to create two programs. The first program (named AsciiToBinary) will read data from an ASCII file and save the data to a new file in a binary format. The second program (named BinaryToAscii) will read data from a binary file and save the data to a new file in ASCII format. Background Preparation: Review file I/O for ascii and binary formatsSpecifications:Your programs will use the following structure to hold the data that is read and to be written:typedef struct _FileData{int a;double b;char dataStr[56];} FileData;Both programs will obtain the filenames to be read and written from command line parameters:bash$ AsciiToBinary ascii_in binary_outbash$ BinaryToAscii binary_in ascii_outThe data format in the ASCII format files (both reading and writing) will be one data item per line:4734.278This is a line of textA sample ASCII format file is provided. There will be a set of three lines for each FileData structure's data. There will be no blank lines between each set of three lines. The size of each record for the binary file will be the same as the size of the FileData structure. The specific method that you use to read and write the data is up to you. You may wish to read all the data from the input file before writing to the output file, or you may wish to write each record as it is read. Be sure to close both files (input and output) before exiting the program. Testing:Besides testing your code with your usual methods, you should also test your programs by reading an ASCII file, converting it to binary, then reading the binary file and converting it to ASCII. The new ASCII file should match exactly with the original ASCII file

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 14:00
The table in columns a-c contains a list of paint color choices for a bathroom and a laundry room. what is a possible sequence of parameters used to organize the data as shown in columns e-g?
Answers: 3
question
Computers and Technology, 21.06.2019 19:30
Write a function processpeople() that takes the name of a file as a parameter. each line of the file corresponds to information about a person. in particular a line contains either a name (in the form lastname,firstname with no spaces in it) or a name (lastname,firstname) and a year. the function will process the file, creating a person object for each line in the file. the function will print information about each line as it processes it, as well as appending the new person object into a list. make sure to use person methods to display information rather than recreating the work you did for the first problem. once the entire file has been processed, the function returns the list of person objects created from the file. if the file is empty, the function should return an empty list. if the input file cannot be opened, the function should print a message to that effect and then return an empty list. the following shows what would be displayed for two example files which have been provided in the link. the file none.txt does not exist. note that your function must work on an arbitrary file that consists of valid lines. you cannot assume anything about the file except that it contains lines that have the format described above.
Answers: 2
question
Computers and Technology, 21.06.2019 22:00
What do the principles of notice, choice, onward transfer, and access closely apply to? a. privacyb. identificationc. retentiond. classification
Answers: 1
question
Computers and Technology, 21.06.2019 23:10
Write a method that accepts a string object as an argument and returns the number of words it contains. for instance, if the argument is "four score and seven years ago", the method should return the number 6. demonstrate the method in a program that asks the user to input a string and then passes that string into the method, printing out whatever the method returns.
Answers: 3
You know the right answer?
For this lab, you are going to create two programs. The first program (named AsciiToBinary) will rea...
Questions
question
Biology, 16.12.2020 22:30
question
Medicine, 16.12.2020 22:30
question
Mathematics, 16.12.2020 22:30
Questions on the website: 13722359