+ 1

How to make it

Type a program that searches for a particular book In a given book list, the list contains unordered book names

23rd Apr 2017, 7:34 AM
muhanad
muhanad - avatar
3 Answers
+ 4
what u got so far?
23rd Apr 2017, 7:36 AM
jay
jay - avatar
+ 2
if the list is in a file read the file content and store every line as a String in an array of Strings get the user input and store it as a String. with a for loop, iterate the lines array to find a match with the input String in every line.
23rd Apr 2017, 8:24 AM
seamiki
seamiki - avatar
+ 1
Step 1 : First we've to put the list of books in an array (either manually by declaring an array(double dimension)say B1[ ][ ] OR with filestream) Step 2 : Take input from user (name of book which is needed to be found) and store it in am array say B2[ ]. Step 3 : Make a loop which goes with respect to length of array B1, the array B2 ought to be checked with each element of array B1, with strcmp function or strcmpi function. If any element of B1 matches with B2, output the value of i (i is the variable that is used to run the loop) Hope it helped. 😊
23rd Apr 2017, 7:43 AM
Jimmy
Jimmy - avatar