Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need to search for any word the user inputs, highlight it in red and show the matches. need to be done in C. fleet
I need to search for any word the user inputs, highlight it in red and show the matches. need to be done in C.
fleet of pigeons to execute user searches-which they planned to use for the Spindle Search. But their luck just ran out, as their fleet of search pigeons were hired by Google (https://archive google.com/pigeonrank) So now it's up to you to implement, search, and SAVE the company. This feature will take a book, and allow the user to enter up to 20 characters to search for a search phrase (e.s. "dog', "test subject"),. Hooli limits search strings to 20 because that was last night's winning lotto number - and they need all the luck they can get. Your program should allow the user to type in a search string (20 chars) and then print the line that the matching substring text was found on. Oh, there is one more problem, all Hooli books are stored as strings without new line characters. So you need to make sure that you break the lines up into 80 character long strings. What happens if a search string spans two lines? Hooli is so cheap to save on CPU usage, they say you can just print the first line the match exists on. However, Hooli wants you to color (highlight) the matching text in red. At the end of the search you should state how many matches were found. Requirements Your program must a. Ask the user for a match (limited to 20 characters) b. Search for a matching substring in the boolk c. Print the line number a match exists on d. Print the line a match starts on e. Print the matching sub-string in red, the rest of the line in white f. Loop-asking for more search strings g. Print how many matches were found h. Each line must only be 80 characters long What is a line? The text that I provided in the header file (books.h) contains a string with no newline characters. That means the string is a single line. You must break this text up into "lines" of 80 characters each. So if you printed the original string it would only print 80 characters, then a new line, then 80 more characters for the second line. When your program prints the matches, it should determine which line the match started on. fleet of pigeons to execute user searches-which they planned to use for the Spindle Search. But their luck just ran out, as their fleet of search pigeons were hired by Google (https://archive google.com/pigeonrank) So now it's up to you to implement, search, and SAVE the company. This feature will take a book, and allow the user to enter up to 20 characters to search for a search phrase (e.s. "dog', "test subject"),. Hooli limits search strings to 20 because that was last night's winning lotto number - and they need all the luck they can get. Your program should allow the user to type in a search string (20 chars) and then print the line that the matching substring text was found on. Oh, there is one more problem, all Hooli books are stored as strings without new line characters. So you need to make sure that you break the lines up into 80 character long strings. What happens if a search string spans two lines? Hooli is so cheap to save on CPU usage, they say you can just print the first line the match exists on. However, Hooli wants you to color (highlight) the matching text in red. At the end of the search you should state how many matches were found. Requirements Your program must a. Ask the user for a match (limited to 20 characters) b. Search for a matching substring in the boolk c. Print the line number a match exists on d. Print the line a match starts on e. Print the matching sub-string in red, the rest of the line in white f. Loop-asking for more search strings g. Print how many matches were found h. Each line must only be 80 characters long What is a line? The text that I provided in the header file (books.h) contains a string with no newline characters. That means the string is a single line. You must break this text up into "lines" of 80 characters each. So if you printed the original string it would only print 80 characters, then a new line, then 80 more characters for the second line. When your program prints the matches, it should determine which line the match started on
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started