Even the smartest students need writing assistance at some point during their academic career. Should you lock yourself in a room and spend the entire weekend trying to write a paper? We promise you that the paper that you pay for won’t be resold or submitted elsewhere. It will also be written according to the instructions that you and your professor provide. Our excellent essays stand out among the rest for a reason. Don’t just take our word, check them out by yourself.
Order a Similar Paper Order a Different Paper
These are blank-delimited files where the most popular name is listed first, the second most popular name is listed second, and so on to the 1,000th most popular name, which is listed last. Each line consists of the first name, followed by a blank space, followed by the number of registered births in the year using that name. For example, the girlnames.txt file begins with:
This indicates that Emily is the most popular name with 25,494 registered namings, Emma is the second most popular with 22,532, and Madison is the third most popular with 19,986.
Write a program that reads both the girl’s and boy’s files into memory using arrays (or vectors) of (pointers to) Name objects (shown below). Then, allow the user to input a name. The program should search through both arrays and, when there is a match, output the popularity and number of namings. The program should also indicate if there is no match.
For example, if the user enters the name “Justice,” the program should output:
Justice is ranked 456 in popularity among girls with 655 namings.
Justice is ranked 401 in popularity among boys with 653 namings.
If the user enters the name “Walter,” the program should output:
Walter is not ranked among the top 1000 girl names.
Walter is ranked 356 in popularity among boys with 775 namings.
Overload the extraction (>>) operator for the Name object class. Note that you will also have to define a default constructor for the Name object class, in which the name defaults to the empty string (“”) or a string such as “NO NAME”, and the popularity defaults to a value such as 0 or -1.
You can then use the overloaded extraction operator to read Name object data from the input stream directly.
Define the Name object class in a header file (.h) and its functions in a source file (.cpp).
In addition, define both the object class and the functions in a custom namespace (e.g., you can use your name).
Once you are done, submit your source code (.h and .cpp) files.