Your program should be made of this following steps: Step 1: Create a list of user actions, consisting of five (5) actions. The five actions will be stored as five strings "add", "remove", "count", "display", "quit", within the list. Step 2: Create a new variable as a dictionary to be used. This dictionary will work as a database and will be used throughout the code. Step 3: Ask the user for an action to do. The expectation is that the user-selected action will be a single word, with all characters in lowercase. Once you run your program, the questions for the user-selected actions should be formatted as follows: What operation would you like to do: quit, add, remove, count, or display: I Step 4: Now, create a loop that works until the user decides to quit (aka, user-selected action selected matches "quit"). any of Step 4a (add operation): Check if the user-selected action, entered in step 3, matches the words defined in step 1. If it does not, show an output saying this is not a valid option. It should show: This is not a valid option, please try again Step 4b: Check if the user-selected action indicates adding NBA championship information (aka, user-selected action matches "add"). If it is, request the user to add a team name. Please enter a team name: Step 4c-a: If the team name is not in the dictionary, ask the user which year this team won the championship (don't worry! You don't actually have to know this!!). You can expect only one year as user input. What year did the team_name win the NBA championship: Step 4c-b: Create a new list with the year this team has won. Now, store the values in the dictionary, using team name as key and list of winning year as value in the dictionary. Step 4c-c: If the team name was already in the dictionary (due to entry in a previous code run), ask the user which year this team won the championship additionally. Again, You can expect only one year as user input. What additional year did the team_name win the NBA championship: Step 4c-d: Now, add this new year, using the team name as key in the dictionary. (hint: Think of a way to add values to an existing list?!) Step 4c-e: Irrespective of how the team information was added, print the action in the console. team_name was added to the dictionary Step 4d-a (remove operation): Check if the user-selected action indicates removing NBA championship information (aka, user-selected action matches "remove"). If it is, request the user to add a team name, use the same prompt as step 4b. Also, print the confirmation of removal action in the console. team_name was removed from the dictionary Step 4d-b: If the team name was already in the dictionary (due to entry in a previous code run), remove the entry from the dictionary. If the name is not in the dictionary, print an error report. This team is not valid, please try again Step 4e (display option): Check if the user-selected action indicates displaying NBA championship information (aka, user-selected action matches "display"). If it is, print the dictionary. Step 4f (count option): Check if the user-selected action indicates counting teams of NBA championship information (aka, user-selected action matches "count"). If it is, report the count of teams in the dictionary. 1 teams have won the NBA championship Step 4g: Complete the loop by asking for user action input again (similar to step 3). This input initiates the whole set of step 4 again. Overall note: This input process is case-sensitive, meaning, it does differentiate between lowercase letters, uppercase letters, and symbols.
Your program should be made of this following steps: Step 1: Create a list of user actions, consisting of five (5) actions. The five actions will be stored as five strings "add", "remove", "count", "display", "quit", within the list. Step 2: Create a new variable as a dictionary to be used. This dictionary will work as a database and will be used throughout the code. Step 3: Ask the user for an action to do. The expectation is that the user-selected action will be a single word, with all characters in lowercase. Once you run your program, the questions for the user-selected actions should be formatted as follows: What operation would you like to do: quit, add, remove, count, or display: I Step 4: Now, create a loop that works until the user decides to quit (aka, user-selected action selected matches "quit"). any of Step 4a (add operation): Check if the user-selected action, entered in step 3, matches the words defined in step 1. If it does not, show an output saying this is not a valid option. It should show: This is not a valid option, please try again Step 4b: Check if the user-selected action indicates adding NBA championship information (aka, user-selected action matches "add"). If it is, request the user to add a team name. Please enter a team name: Step 4c-a: If the team name is not in the dictionary, ask the user which year this team won the championship (don't worry! You don't actually have to know this!!). You can expect only one year as user input. What year did the team_name win the NBA championship: Step 4c-b: Create a new list with the year this team has won. Now, store the values in the dictionary, using team name as key and list of winning year as value in the dictionary. Step 4c-c: If the team name was already in the dictionary (due to entry in a previous code run), ask the user which year this team won the championship additionally. Again, You can expect only one year as user input. What additional year did the team_name win the NBA championship: Step 4c-d: Now, add this new year, using the team name as key in the dictionary. (hint: Think of a way to add values to an existing list?!) Step 4c-e: Irrespective of how the team information was added, print the action in the console. team_name was added to the dictionary Step 4d-a (remove operation): Check if the user-selected action indicates removing NBA championship information (aka, user-selected action matches "remove"). If it is, request the user to add a team name, use the same prompt as step 4b. Also, print the confirmation of removal action in the console. team_name was removed from the dictionary Step 4d-b: If the team name was already in the dictionary (due to entry in a previous code run), remove the entry from the dictionary. If the name is not in the dictionary, print an error report. This team is not valid, please try again Step 4e (display option): Check if the user-selected action indicates displaying NBA championship information (aka, user-selected action matches "display"). If it is, print the dictionary. Step 4f (count option): Check if the user-selected action indicates counting teams of NBA championship information (aka, user-selected action matches "count"). If it is, report the count of teams in the dictionary. 1 teams have won the NBA championship Step 4g: Complete the loop by asking for user action input again (similar to step 3). This input initiates the whole set of step 4 again. Overall note: This input process is case-sensitive, meaning, it does differentiate between lowercase letters, uppercase letters, and symbols.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
How will this project be solved in Python? Thanks.
There are example outputs in the picture.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education