C11 standard.... file1.txt: DAY Blackberry Blueberry Pear Mango apple Monday 60 35 32 16 30 Tuesday 44 22 34...

50.1K

Verified Solution

Question

Programming

C11 standard....

file1.txt:

DAY Blackberry Blueberry Pear Mango apple
Monday 60 35 32 16 30
Tuesday 44 22 34 62 54
Wednesday 33 14 67 13 22
Thursday 24 44 35 15 42
Friday 36 43 24 34 29

file2.txt:

DAY Milk Cheese Butter Cream Yogurt
Monday 50 25 32 16 512
Tuesday 64 12 34 62 97
Wednesday 23 54 67 13 62
Thursday 34 54 25 35 127
Friday 76 23 54 24 120

Here, in the text file, the first line is column title containsless than 100 characters.

Each subsequent line contains six data items separated byspace:

-The day of the week as a string containing no spaces with alength of less than 25 characters.
- Five additional items in each line that are the numbers of eachfood item is sold in as a string with length less than 15characters.

-The number of columns in the file is fixed at 6.

TO DO-

Read the two text files and swap the data in the Apple column offile1.txt with Yogurt column of file2.txt and write the correcteddata in file1-revised.txt and file2-revised.txt.

Assume that Apple and Yogurt is in the last column of file1.txtand file2.txt. Column title should not be modified.

Use feof() function to detect the end of lines.

Number of columns are fixed but number of rows can vary.

Answer & Explanation Solved by verified expert
3.8 Ratings (527 Votes)
Code for your program is provided below It is explainedthoroughly in code comments You can also refer to the screenshotof properly indented code in IDE that i have attached in the lastOutput screenshot is also providedIf you need any further clarification please feel free to askin comments I would really appreciate if you would let me know ifyou are satisfied with the explanation providedCODEinclude for standard input outputinclude for using exitint main FILE myFile1 file pointer for first file FILE myFile2 file pointer for second file FILE outputFile1 file pointer for first modified file FILE outputFile2    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students