Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

**PLEASE USE PYTHON ONLY** Use and edit the following python code and implement the new changes below: (make sure code is working properly after editing

**PLEASE USE PYTHON ONLY**

Use and edit the following python code and implement the new changes below: (make sure code is working properly after editing original)

1) Add a list of 3 movies per category (EX: MovieA1,MovieA2,MovieA3 for G, MovieB1,MovieB2,MovieB3 for PG-13, MovieC1,MovieC2,MovieC3 for R and, MovieD1,MovieD2,MovieD3 for NC-17)

2) Instead of asking the user to enter a movie category ask the user to enter a movie title (reference MovieA1 or MovieB2 or Movie C3)

3) Make sure the movie title matches to user_age (Example: user_age must be at least 13 or older to watch anything in PG-13 or less which is MovieB1,MovieB2,MovieB3 and everything below that as well such as MovieA1,MovieA2,MovieA3 located in the "G" (General) category. For example, if user is not 13 he will NOT have access to view MovieB1,B2,B3.

CODE THAT NEEDS TO BE EDITED TO MATCH ABOVE QUESTIONS:

#Ask user information to be stored and processed based upon their attribute my_movie_category = input("Please pick a movie rating (G/PG-13/R/NC-17)..." ) user_age = int(input("Enter your current age..." ))

#Starting with General Rating if(my_movie_category == "G"): print("You are of general viewing, congratulations you are able to view this film/movie")

#PG-13 Category elif(my_movie_category == "PG-13"): #Checking if user is younger than 13 if(user_age < 13): print("You are not 13 or older, your age restricts your from viewing this film/movie") #Otherwise if user_age is more than 13 user should be able to view this: else: print("You are 13 years of age or older, congratulations you are able to view this film/movie")

#Rated R Category elif(my_movie_category == "R"): #Checking if user is younger than 17 if(user_age < 17): print("You are not 17 or older, your age restricts your from viewing this film/movie") #Same thing here if user_age is 17 or greater than they have access else: print("You are 17 years of age or older, congratulations you are able to view this film/movie")

#NC-17 Category elif(my_movie_category == "NC-17"): #Once again check user attribute if age is under 18 if(user_age < 18): print("You are not 18 years of age or older, please wait until you turn 18 to view this film/movie") #Performing our else statement here to see if user_age input is over 17 else: print("You are 18 years of age or older, congratulations you are able to view this film/movie")

#We need to be able to make sure that the user only inputs what we ask for in this case being G/PG-13/R/NC-17 #As well as the integer input for user_age must match otherwise they will recieve the following message: else: print("You have entered an Invalid Input, please make sure to read all instructions accordingly!")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

Prove Theorem 7.15(d).

Answered: 1 week ago