subject

I need help writing 3 files, myio. c, driver1.c, and driver2.c. I have provided myio. h down below:Implement the following library and driver programs under assign0:Your library will be consisting of myio. h and myio. c. The function prototypes as well as more explanations are listed in myio. h. Please download it and accordingly implement the exported functions in myio. c. Basically, you are asked to develop a simple I/O library which exports a few functions to simplify the reading of an integer, a double, and more importantly a string (whole line). In contrast to standard I/O functions that can read strings (e. g., scanf with "%s", fgets) into a given static size buffer, your function should read the given input line of characters terminated by a newline character into a dynamically allocated and resized buffer based on the length of the given input line. Also your functions should check for possible errors (e. g., not an integer, not a double, illigal input, no memory etc.) and appropriately handle them. Then write driver programs that can simply use the functions from myio library. Specifically, you will write two driver programs:First one (say driver1.c) gets three command-line arguments: x y z. It then asks user to enter x many integers, y many doubles, and z many lines. Everytime the program prints back the entered data on the stdout while printing error messages on stderr (if any). It also keeps track of the largest integer, double and the longest string. At the end, your program prints the largest intiger, double and the longest line. string that were entered. Second one (say driver2.c) gets two command-line arguments: input_file. txt output_file. txt. Here is a sample input_file. txt , which is a text file containig many lines. Your program reads each line and removes theextra space characters between the words and prints the new line into output_file. txt. So there will be at most one space character between the words in output_file. txt. myio. h :/* * File: myio. h * Version: 1.0 * Last modified on Wed Dec 12 11:37:26 2016 by korkmaz * This is mostly from a similar file provided by eroberts * * This interface provides access to a basic library of * functions that simplify the reading of input data. */#ifndef _myio_h#define _myio_h/* * Function: ReadInteger * Usage: i = ReadInteger(); * * ReadInteger reads a line of text from standard input and scans * it as an integer. The integer value is returned. If an * integer cannot be scanned or if more characters follow the * number, the user is given a chance to retry. */int ReadInteger(void);/* * Function: ReadDouble * Usage: x = ReadDouble(); * * ReadDouble reads a line of text from standard input and scans * it as a double. If the number cannot be scanned or if extra * characters follow after the number ends, the user is given * a chance to reenter the value. */double ReadDouble(void);/* * Function: ReadLine * Usage: s = ReadLine(); * * ReadLine reads a line of text from standard input and returns * the line as a string. The newline character that terminates * the input is not stored as part of the string. */char *ReadLine(void);/* * Function: ReadLine * Usage: s = ReadLine(infile); * * ReadLineFile reads a line of text from the input file which * is already open and pointed by infile. It then reads the line, * dynamically allocates space, and returns the line as a string. * The newline character that terminates the input is not stored * as part of the * string. * The ReadLine function returns NULL if infile is at the * end-of-file position. * Note: the above ReadLine(); can simply be implemented as * { return(ReadLineFile(stdin)); } */char *ReadLineFile(FILE *infile);#endif

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:40
Write c function that can replace all the positive elements to 0 and negative to 1 in undefined length one-dimensional array. test your program in the main program by defining one-dimensional array of 6 elements
Answers: 1
question
Computers and Technology, 21.06.2019 22:00
Your task this week is to write a very simple spam classifier in python. it will classify messages as either spam (unwanted) or ham (wanted). the program will have a set of spam_words, words that are known to appear in spam messages. that set is included in the template file spam.pypreview the document. you will also define a spam threshold which reflects the allowed percentage of spam words in the message. you'll compute a 'spam indicator', which is the ratio of spam words to the total number of unique words in the message. if the spam indicator exceeds the spam threshold, the message is classified as spam. otherwise it is classified as ham. we'll assume that the spam threshold is a constant and has a value of 0.10. your program will prompt the user for a message and then will print the corresponding spam indicator with two decimal digits and the corresponding classification (spam or ham). the program will be case insensitive. the spam words are detected whether they are in lower case or upper case or mixed case. each word, spam or not, is counted once (even if it appears multiple times in the message.) the program will remove punctuation from the message before identifying the words and computing the spam indicator. for example '! ' must be identified as the spam word 'now'.
Answers: 3
question
Computers and Technology, 22.06.2019 16:30
Primary tech skills are skills that are necessary for success in online education
Answers: 3
question
Computers and Technology, 22.06.2019 17:00
Annie is creating a corporate report for a company’s annual meeting. in the report, she wants to add the signature of various department heads. which device can annie use to capture signatures to include in the report? a. printer b. monitor c. e-reader d. digitizing tablet
Answers: 1
You know the right answer?
I need help writing 3 files, myio. c, driver1.c, and driver2.c. I have provided myio. h down below:I...
Questions
question
Mathematics, 14.07.2019 22:30
question
History, 14.07.2019 22:30
Questions on the website: 13722361