Lexington High School Mathematics Math Dept. Front Page  | Student Links  | Family Links 
Introduction to C++, Kevin Kelly Kelly Front Page  | C++ Course Guide | C++ Assignments | C++ Info

Assignment 29: Searching for words

due Monday 5/13

The ability to search for information is a powerful feature in many computer programs. This assignment is to write a simple kind of search program. Here is what your program should do:

Sample runs: Include at least three runs, with the search word being found exactly once, more than once, and not at all.

Extension

Enable the program to match substrings within a string. For example, if the user searches for "put", it would be found within the string "Computer". You'll need to read ahead in the strings chapter to learn a function that finds strings inside other strings -- see section 12.5 in particular.