***Please only use for, while, if/else loop. Don't use function calls.***
movies = [[1939, Gone With the Wind, drama], [1943, Casablanca, drama], [1965, 'The Sound of Music', 'musical'], [1969, Midnight Cowboy, drama], [1972, 'The Godfather', 'drama'], [1973, The Sting, comedy], [1977, 'Annie Hall', 'comedy'], [1982, Gandhi, historical], [1986, Platoon, action], [1990, 'Dances with Wolves', 'western'], [1992, 'Unforgiven', 'western'], [1994, 'Forrest Gump', 'comedy'], [1995, 'Braveheart', 'historical'], [1997, 'Titanic', 'historical'], [1998, 'Shakespeare in Love', 'comedy'], [2000, 'Gladiator', 'action'], [2001, A Beautiful Mind, historical], [2002, 'Chicago', 'musical'], [2009, 'The Hurt Locker', 'action'], [2010, 'The Kings Speech', 'historical'], [2011, 'The Artist', 'comedy'], [2012, 'Argo', 'historical'], [2013, '12 Years a Slave', 'drama'], [2014, 'Birdman', 'comedy'], [2016, 'Moonlight', 'drama'], [2017, 'The Shape of Water', 'fantasy']]
IT-109 - Assignment 4 (A4) - Oscar Movie List Display Assignment Given: 02/18/2020 Assignment Due: 02/25/2020 In this assignment you are asked to write a Python program to create a sinall interactive application to search and display information from a list of movies that won the Academy Award (Oscar) for best picture. The data is held in a list structure consisting of the movie's year, title, and category. The movie the list is: movies = [[1939, 'Gone With the Wind', 'drama'], [1943, Casablanca', 'drama'], [1965, 'The Sound of Music', 'musical') [1969, Midnight Cowboy, drama'], [1972, 'The Godfather', 'drama'], [1973, 'The Sting, comedy'], [1977, 'Annie Hall', 'comedy'], [1982, 'Gandhi', 'historical'], [1986, Platoon, 'action'], [1990, 'Dances with Wolves', 'western'], [1992, 'Unforgiven', 'western'], (1994, 'Forrest Gump', 'comedy'), [1995, 'Braveheart', 'historical'], [1997, 'Titanic', 'historical'), [1998, 'Shakespeare in Love', 'comedy'], [2000, 'Gladiator', 'action'], [2001, 'A Beautiful Mind, historical'], [2002, 'Chicago', 'musical'], [2009, 'The Hurt Locker', 'action'], [2010, "The Kings Speech', 'historical'), [2011, 'The Artist', 'comedy'), [2012, 'Argo', 'historical'], [2013, '12 Years a Slave', 'drama'], [2014, 'Birdman', 'comedy'], [2016, 'Moonlight', 'drama'], [2017, 'The Shape of Water', 'fantasy'll The program includes the above list as a given - copy it into your program source. When run, the program displays a simple menu of options for the user. Depending on the option selected, a movie title for a given year is displayed the title and category are displayed or only movies in a specified category are displayed. The following is a sample menu to show how the options might be presented to the user: menu = 1 - display winning movie by year 2 - display movie and category by year p-print entire movie list-year, title, category pc-print movies in a selected category - year and title 4- qut Select one of the menu options above Note that the menu is a string variable with the name "menu". To display it: print(menu). The program reads the options and validates that the choice is on the menu. If not, the user is prompted to enter a valid one. When a year is entered for options 1 and 2 a check is made to ensure it's within a valid range (1927 to 2020) and whether that year's movie information is already on the list. If the year is out of range the user is prompted to re-enter. If it is in range and on the list, the information is displayed. For the 'p'option the program iterates through the list and prints the movie information in a readable format. Printing the entire list with one print command is not sufficient. For pc', prompt for a category and print every movie title in the list with the specific category. Print no matches' if there are no movies in the entered category To do this assignment: 1. Decide what the program needs to do and in what order (program logic). Consider writing pseudo-code to act as a rough guide on how to structure the program. 2. Write the Python code. In addition to the basic control structures (if, while, and for) you will need to process a list. 3. Use the Python interpreter mode if needed to be sure your statements will have the results you want 4. Make sure your program has no syntax errors (statements or symbols Python doesn't recognize). 5. When the program is completely written and the syntax errors removed, test the program's logic by running it multiple times. Use the list of inputs and expected outputs you developed earlier as a testbed. 6. Consider writing the program in small steps. First write the code to display the menu, then add logic to prompt for input, then validate the prompt, then the item and cost prompts. Finally, add the code to calculate the category item and cost totals and display them. What and where to submit: 1. Subinit by uploading a single file with the Python code to Blackboard 2. Naine the submitted file:
_A4.py. For example: mary_simith_A4.py. 3. Input a set of comment lines at the top of the code that identifies the program, its purpose, and its author. Comment lines start with the '#' character. Feel free to follow the examples I've included in class and in sample code 4. The file must execute from the command line, so include the following line of code at the end of the program to ensure the program screen doesn't immediately erase when execution stops: input (n'nHit Enter to end program) How the assignment will be assessed The Python code will be visually inspected and executed via "double-click" or command line. The GTA will run it multiple times to ensure the results are correct and the messages conform to the assignment specification. The GTA will assess each of the following and assign a point value for each. Max Value Item Python code Menu and navigation option 1 option 2 Assessment Description A complete program is submitted, is named correctly, and includes appropriate and readable comment lines Code displays a readable menu with all items and the option selected is correctly validated and 'q' stops execution Code executes correct logic for option 1 Code executes correct logic for option 2 IT-109 - Assignment 4 (A4) - Oscar Movie List Display Assignment Given: 02/18/2020 Assignment Due: 02/25/2020 In this assignment you are asked to write a Python program to create a sinall interactive application to search and display information from a list of movies that won the Academy Award (Oscar) for best picture. The data is held in a list structure consisting of the movie's year, title, and category. The movie the list is: movies = [[1939, 'Gone With the Wind', 'drama'], [1943, Casablanca', 'drama'], [1965, 'The Sound of Music', 'musical') [1969, Midnight Cowboy, drama'], [1972, 'The Godfather', 'drama'], [1973, 'The Sting, comedy'], [1977, 'Annie Hall', 'comedy'], [1982, 'Gandhi', 'historical'], [1986, Platoon, 'action'], [1990, 'Dances with Wolves', 'western'], [1992, 'Unforgiven', 'western'], (1994, 'Forrest Gump', 'comedy'), [1995, 'Braveheart', 'historical'], [1997, 'Titanic', 'historical'), [1998, 'Shakespeare in Love', 'comedy'], [2000, 'Gladiator', 'action'], [2001, 'A Beautiful Mind, historical'], [2002, 'Chicago', 'musical'], [2009, 'The Hurt Locker', 'action'], [2010, "The Kings Speech', 'historical'), [2011, 'The Artist', 'comedy'), [2012, 'Argo', 'historical'], [2013, '12 Years a Slave', 'drama'], [2014, 'Birdman', 'comedy'], [2016, 'Moonlight', 'drama'], [2017, 'The Shape of Water', 'fantasy'll The program includes the above list as a given - copy it into your program source. When run, the program displays a simple menu of options for the user. Depending on the option selected, a movie title for a given year is displayed the title and category are displayed or only movies in a specified category are displayed. The following is a sample menu to show how the options might be presented to the user: menu = 1 - display winning movie by year 2 - display movie and category by year p-print entire movie list-year, title, category pc-print movies in a selected category - year and title 4- qut Select one of the menu options above Note that the menu is a string variable with the name "menu". To display it: print(menu). The program reads the options and validates that the choice is on the menu. If not, the user is prompted to enter a valid one. When a year is entered for options 1 and 2 a check is made to ensure it's within a valid range (1927 to 2020) and whether that year's movie information is already on the list. If the year is out of range the user is prompted to re-enter. If it is in range and on the list, the information is displayed. For the 'p'option the program iterates through the list and prints the movie information in a readable format. Printing the entire list with one print command is not sufficient. For pc', prompt for a category and print every movie title in the list with the specific category. Print no matches' if there are no movies in the entered category To do this assignment: 1. Decide what the program needs to do and in what order (program logic). Consider writing pseudo-code to act as a rough guide on how to structure the program. 2. Write the Python code. In addition to the basic control structures (if, while, and for) you will need to process a list. 3. Use the Python interpreter mode if needed to be sure your statements will have the results you want 4. Make sure your program has no syntax errors (statements or symbols Python doesn't recognize). 5. When the program is completely written and the syntax errors removed, test the program's logic by running it multiple times. Use the list of inputs and expected outputs you developed earlier as a testbed. 6. Consider writing the program in small steps. First write the code to display the menu, then add logic to prompt for input, then validate the prompt, then the item and cost prompts. Finally, add the code to calculate the category item and cost totals and display them. What and where to submit: 1. Subinit by uploading a single file with the Python code to Blackboard 2. Naine the submitted file: _A4.py. For example: mary_simith_A4.py. 3. Input a set of comment lines at the top of the code that identifies the program, its purpose, and its author. Comment lines start with the '#' character. Feel free to follow the examples I've included in class and in sample code 4. The file must execute from the command line, so include the following line of code at the end of the program to ensure the program screen doesn't immediately erase when execution stops: input (n'nHit Enter to end program) How the assignment will be assessed The Python code will be visually inspected and executed via "double-click" or command line. The GTA will run it multiple times to ensure the results are correct and the messages conform to the assignment specification. The GTA will assess each of the following and assign a point value for each. Max Value Item Python code Menu and navigation option 1 option 2 Assessment Description A complete program is submitted, is named correctly, and includes appropriate and readable comment lines Code displays a readable menu with all items and the option selected is correctly validated and 'q' stops execution Code executes correct logic for option 1 Code executes correct logic for option 2