Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please use Python for this program. And use # to explain the code so I can understand. Thanks! And I had attached the rubric for
Please use Python for this program. And use # to explain the code so I can understand. Thanks! And I had attached the rubric for this program.
Popular Names This program will use two files: GirlNames.txt and BoyNames.txt. They each contain the 200 most popular names for the years 2000-2009. You must download these files to your computer and place them in the directory that your Python program will run from. There is a video that will explain how to download these files. Write a program that reads the contents of the two files into separate lists. The user will then be able to enter a name and the application will display messages indicating whether the name is among the most popular in each list and where the name ranked in each list. Sample execution: Python 364 Shel File Edit Shell Debug Options Window Help Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel) on win32 Type "copyright", "credits" or "license for more information RESTART: P:/Cmpsc131/Programming Assignment Solutions/PA9PopularName.py Enter a name to see if it is a popular girls or boys name. Enter a name to check, or "stop" to stop: Alyssa Alyssa is a popular girls name and is ranked: 14 Alyssa is not a popular boys name. Enter a name to check, or "stop" to stop: Fred Fred is not a popular girls name. Fred is not a popular boys name. Enter a name to check, or "stop" to stop: Riley Riley is a popular girls name and is ranked: 67 Riley is a popular boys name and is ranked: 107 Enter a name to check, or "stop" to stop: stop GirlNames File to Download for PA9 Emily Madison Emma Olivia Hannah Abigail Isabella Samantha Elizabeth Ashley Alexis Sarah Sophia Alyssa Grace Ava Taylor Brianna Laurern Chloe Natalie Kayla Jessica Anna Victoria Mia Hailey Sydney Jasmine Julia Morgan Destiny Rachel Ella Kaitlyn Megan Katherine Savannah Jennifer Alexandra Allisorn Haley Maria Kaylee Lily Makayla Brooke BoyNames File to Download for PA9 I] Jacob Michael Joshua Matthew Daniel Christopher Andrevw Ethan Joseph William Anthony David Alexander Nicholas Ryan Tyler James John Jonathan Noah Brandon Christian Dylan Samuel Benjamirn Zachary Nathan Logan Justirn Gabriel Jose Austin Kevin Elijah Caleb Robert Thomas Jordan Cameron Jack Hunter Jackson Angel Isaiah Evan Isaac Mason Luke Up to-10 for not using good standard programming conventions 20 file operations 5 opening -5 closing (combined if they use the with open construct) -10 reading a line in a loop 20 points list operations - 10 storing names in a list 10 ensuring the extra newline is taken care of by rstrip or otherwise 40 calculating popular names 10 detecting popular names 20 knowing the rank 15 knowing ranking . 5 ensure the +1 to fix indexing 10 correct if else to take care of when you don't find anything 10 user input ensuring while loop is correct. Popular Names This program will use two files: GirlNames.txt and BoyNames.txt. They each contain the 200 most popular names for the years 2000-2009. You must download these files to your computer and place them in the directory that your Python program will run from. There is a video that will explain how to download these files. Write a program that reads the contents of the two files into separate lists. The user will then be able to enter a name and the application will display messages indicating whether the name is among the most popular in each list and where the name ranked in each list. Sample execution: Python 364 Shel File Edit Shell Debug Options Window Help Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel) on win32 Type "copyright", "credits" or "license for more information RESTART: P:/Cmpsc131/Programming Assignment Solutions/PA9PopularName.py Enter a name to see if it is a popular girls or boys name. Enter a name to check, or "stop" to stop: Alyssa Alyssa is a popular girls name and is ranked: 14 Alyssa is not a popular boys name. Enter a name to check, or "stop" to stop: Fred Fred is not a popular girls name. Fred is not a popular boys name. Enter a name to check, or "stop" to stop: Riley Riley is a popular girls name and is ranked: 67 Riley is a popular boys name and is ranked: 107 Enter a name to check, or "stop" to stop: stop GirlNames File to Download for PA9 Emily Madison Emma Olivia Hannah Abigail Isabella Samantha Elizabeth Ashley Alexis Sarah Sophia Alyssa Grace Ava Taylor Brianna Laurern Chloe Natalie Kayla Jessica Anna Victoria Mia Hailey Sydney Jasmine Julia Morgan Destiny Rachel Ella Kaitlyn Megan Katherine Savannah Jennifer Alexandra Allisorn Haley Maria Kaylee Lily Makayla Brooke BoyNames File to Download for PA9 I] Jacob Michael Joshua Matthew Daniel Christopher Andrevw Ethan Joseph William Anthony David Alexander Nicholas Ryan Tyler James John Jonathan Noah Brandon Christian Dylan Samuel Benjamirn Zachary Nathan Logan Justirn Gabriel Jose Austin Kevin Elijah Caleb Robert Thomas Jordan Cameron Jack Hunter Jackson Angel Isaiah Evan Isaac Mason Luke Up to-10 for not using good standard programming conventions 20 file operations 5 opening -5 closing (combined if they use the with open construct) -10 reading a line in a loop 20 points list operations - 10 storing names in a list 10 ensuring the extra newline is taken care of by rstrip or otherwise 40 calculating popular names 10 detecting popular names 20 knowing the rank 15 knowing ranking . 5 ensure the +1 to fix indexing 10 correct if else to take care of when you don't find anything 10 user input ensuring while loop is correct Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started