I'm sorry, I didn't realize I couldn't upload the exe file - but I have it ready to email.
I'm having a big problem understanding how to complete this assignment and would really appreciate someone's help in getting me started.
Basically, we are taking baby names from a file and opening the file up in our program. we are using arrays (I believe a 2 dimensional array) and taking it from a file named babynames2004.txt and putting that data into the array.
this program is supposed to output to the screen:
"Enter the first name that you would like to find the
popularity of from baby names in 2004.
Be sure to capitalize the first letter of the name."
if you enter Melissa, for example, it will output:
"Melissa is not ranked among the top 1000 boy names.
Melissa is ranked 100 in popularity among girls
Press any key to continue..."
I have attached the text file fo anyone willing to help me continue the project.
I have to load the boy names and the girl names from the file into separate arrays and search for the target name from the arrays, not directly from the file.
here is what I have so far, someone pleeeease help me :)
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
int main
{
ifstream in_put;
char enter_name
in_put.open("babynames2004.txt");
if (in_put.fail())
{
cout << "Input file opening failed.\n";
exit(1)
}
cout << "Enter the first name that you would like to find the\n;"
<< "popularity of from baby names in 2004.\n;"
<< "Be sure to capitalize the first letter of the name.\n"
cin >> enter_name;
int index = 0, count = 0;
char boys_name[1000][10], girls_name[1000][10];
char data;
while (in_put.get(data))
{
boys_name[index][count] = data;
girls_name[index][count] = data;
for (count += 1; count < 10; count ++)
{
char boys_name[index][count] = input.get(data);
if (data == ' ')
char girls_name [index][count] = in_put.get(data);
}
system("Pause");
return 0;
}