Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need assistance in this program that should be written in C. Will read from a Declaration of Independence text file, which can be found through

Need assistance in this program that should be written in C. Will read from a Declaration of Independence text file, which can be found through a quick google search.image text in transcribed

Although it should work on any input file and any substring, we'll provide a copy of an input file to use for testing (i.e "Decl of Indep.txt'). Overview Here's a high level overview of what your program should do: 1) Ask the user for the name of the input file a) If the file is not present or can't be opened, display an error message and ask the user to enter another file name. 2) Ask the user for the substring to search for. 3) Calculate and display the found occurrences of the substring in the file. For each found occurrence, your program should display (a) the location number starting at 1 and going up to the total number of locations found, and (b) the portion of the string containing the found substring. This portion should consist of the substring and 8 characters before and 8 characters after the found substring. Sample Runs Here is a sample run looking for the string "people" in the file "Decl of Indep.txt'' Looking for the substring "people" in file "Decl of Indep.txt" Location 1 for one people to String Location 2: String icts of people, unless Location 3 s tit ho see people would r String Location O f the people String Location 5 OI Ou r people String

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Linked Data A Geographic Perspective

Authors: Glen Hart, Catherine Dolbear

1st Edition

1000218910, 9781000218916

More Books

Students also viewed these Databases questions

Question

Why is intuition still an important aspect of decision making?

Answered: 1 week ago