Write a program in C++ to help new parents finda name for their baby. The file BabyNames.dat contains a list ofthe most popular names for boys and girls, ranked according totheir popularity.
The user should be able to choose whether to look for boys’names or girls’ names and to specify which letter of the alphabetthe names should begin with. E.g. I may want to look for girls’names starting with an ‘E’. Your program should copy the names thatsatisfy the user’s criteria (girls’ names starting with an ‘E’ inmy example) to another file and include the ranking allocated tothe name.
E.g. if BabyNames.dat contains the following data showing thatJames is the most popular boys’ name and Ellen the most populargirls’ name, with Michael and Nazeera in the 10th place:
1 James Ellen
2 Peter Eleanor
3 Rodger Mary
4 John Elise
5 Mpho Anne
6 Molefe Ella
7 Zaheer Petunia
8 Charles Eugenie
9 Tabang Charlotte
10 Michael Nazeera
The output file should look as follows, showing all the namesstarting with an ‘E’ and their rank:
1 Ellen
2 Eleanor
4 Elise
6 Ella
8 Eugenie
Write a program in C++ to help new parents find a name for their baby. The file BabyNames.dat contains a list of the mos
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am