Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement the following program: 1) Define a class Director with two attributes name and numFilms. 2) Define an init function for Director which sets

 

Implement the following program: 1) Define a class Director with two attributes name and numFilms. 2) Define an init function for Director which sets the attribute value via input parameters. 3) Define a class Film with three attributes title, rating and director. 4) The Film attribute director is an object of type Director. 5) Define an init function for Film which sets the attribute values via input parameters. 6) Define a print function for Film which prints all attribute values. 7) Create an instance of Film with the values "Star Wars", "PG" and "George Lucas" and 20. 8) Call the Film print function. Example Output Movie Title : Star Wars Director George Lucas Rating: PG Num Films: 20

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Heres the implementation of the program described python class Director def initself name numFilms s... 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

Elementary Principles of Chemical Processes

Authors: Richard M. Felder, Ronald W. Rousseau

3rd Edition

978-0471687573, 9788126515820, 978-0-471-4152, 0471720631, 047168757X, 8126515821, 978-0471720638

More Books

Students also viewed these Algorithms questions

Question

Discuss the significance of evolutionary theory to psychology.

Answered: 1 week ago