Book 1

Today - Search program

Type the Program on (Frequency of Letters)

Computer Club meeting on 30th November at the STUDENT UNION MULTIPURPOSE ROOM,  GOOD FOOD WILL BE SERVED, sponsored by C-STEP

Buscar- Spanish for Search

Phrases of the day:

                             Stick to the rule that is the most important in your life

                            Let people know about your goodness

                            Medicine are bitter- Snakes are poisonous and can be used as medicine, this is to balance the chemical     reaction.

 

 

Type Search program on visual studios

You have to have a data file for this program

 

 

#include<fstream>

#include<string>

#include<iostream>

using namespace std;

main(){

char searchname[15], itemname[15], associateitem[14], filename[13];

cout<< "ENTER THE DATA FILE NAME:";

cin>> filename;

cout<<endl<<"ENTER THE SEARCH NAME:";

cin>> searchname;

ifstream fin( filename );

while( fin>> itemname >> associateitem ){

if( strcmp( searchname, itemname ) ==0 ){

cout<<associateitem <<endl;

return 0;

} // end of if

} // end of loop

cout<< "NAME NOT FOUND" <<endl;

return 0;

} // end of main