Help with homework please

The textfile babynames.txt, which is included in the books website, contains a list of the 1000 most popular baby names of boys and girls. Write a program that allows the user to input a name and the program should then read the file and search the matching names among the boys and the girls. If the name is found it should output the name and the names rank. It should also indicate if their is no match.

I have no idea how to start this. Can someone help me out pleae?
learn about random number XD, i like making these

1
2
3
4
5
6
7
8
9
10
11
12
13

public void namegen ()
{

//for random number gens here//

string array_of_firstnames[];
string array_of_secondnames[];
string array_ot_titles[]
string array_of_fiefdoms[];

cout<<array_of_titles[RANDOM1]<<array_of_firstnames[RANDOM2]<<" "<<array_of_secondnames[RANDOM3]<<" of "<<array_of_fiefdoms[RANDOM4]<<endl; 


output
 
lady bruchetta doorhandle of doorchester


oh yeah and just read file onto a string, make sure you dont use getline, or suss out how to get what you want line by line.
Last edited on
Topic archived. No new replies allowed.