Homework 26: Search
Name: _____________________________________________ Alpha: ___________________
Describe help received: ________________________________________________________
- Due before class on Monday, March 27
- This homework contains code to be submitted electronically.
Put your code in a folder called
hw26and submit using the204subcommand. - This is an electronic homework and you do not need to print out anything to turn in during class.
Assignment
- Required reading: Sections 2.4 (Sorting any type) and all of section 3 (Search) from the Unit 7 notes,
- Write a program
findname.cthat reads in 5 names, then asks for a single letter, and prints out the first name that starts with that letter. If there is no name that starts with that letter, print "not found".Example runs:
roche@ubuntu$./findnameEnter 5 names:Judy Bill Deke John SuzyLetter:BBillroche@ubuntu$./findnameEnter 5 names:Judy Bill Deke John SuzyLetter:JJudyroche@ubuntu$./findnameEnter 5 names:Judy Bill Deke John SuzyLetter:Qnot found