⚫ Task 1: Create a Class Tasks Define a class named Person with attributes name and age. Write a method greet() that prints a greeting message including the person's name and age. ⚫ Task 2: Rectangle Class Create a class Rectangle that takes length and width as parameters. Add methods area() and perimeter() to calculate and return the area and perimeter of the rectangle. ⚫ Task 3: Object Interaction Create a Library dass that contains a list of books and methods to add, remove, and list all books in the library. • Task 4: Movie Class Create a class Movie with attributes title, director, and rating. Add a method display_info() that prints the movie's details and a method rate_movie (new_rating) to update the movie's rating. • Task 5: Ticket Class (homework) Define a class Ticket' with attributes event_name, date, and `price. Add methods apply_discount(discount_percentage) to reduce the price by a given percentage and display_ticket()` to print the ticket details including the final price after any discounts.
⚫ Task 1: Create a Class Tasks Define a class named Person with attributes name and age. Write a method greet() that prints a greeting message including the person's name and age. ⚫ Task 2: Rectangle Class Create a class Rectangle that takes length and width as parameters. Add methods area() and perimeter() to calculate and return the area and perimeter of the rectangle. ⚫ Task 3: Object Interaction Create a Library dass that contains a list of books and methods to add, remove, and list all books in the library. • Task 4: Movie Class Create a class Movie with attributes title, director, and rating. Add a method display_info() that prints the movie's details and a method rate_movie (new_rating) to update the movie's rating. • Task 5: Ticket Class (homework) Define a class Ticket' with attributes event_name, date, and `price. Add methods apply_discount(discount_percentage) to reduce the price by a given percentage and display_ticket()` to print the ticket details including the final price after any discounts.
Chapter16: Graphics
Section: Chapter Questions
Problem 16RQ
Related questions
Question
![⚫ Task 1: Create a Class
Tasks
Define a class named Person with attributes name and age. Write a method greet() that prints a greeting
message including the person's name and age.
⚫ Task 2: Rectangle Class
Create a class Rectangle that takes length and width as parameters. Add methods area() and perimeter() to
calculate and return the area and perimeter of the rectangle.
⚫ Task 3: Object Interaction
Create a Library dass that contains a list of books and methods to add, remove, and list all books in the library.
• Task 4: Movie Class
Create a class Movie with attributes title, director, and rating. Add a method display_info() that prints the
movie's details and a method rate_movie (new_rating) to update the movie's rating.
• Task 5: Ticket Class (homework)
Define a class Ticket' with attributes event_name, date, and `price. Add methods
apply_discount(discount_percentage) to reduce the price by a given percentage and display_ticket()` to print
the ticket details including the final price after any discounts.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5ca81092-878b-49c4-b166-b7fc2d8befcc%2Fcf2ff035-6b96-4fc1-a73f-c1eacd5771af%2F57jmdv_processed.jpeg&w=3840&q=75)
Transcribed Image Text:⚫ Task 1: Create a Class
Tasks
Define a class named Person with attributes name and age. Write a method greet() that prints a greeting
message including the person's name and age.
⚫ Task 2: Rectangle Class
Create a class Rectangle that takes length and width as parameters. Add methods area() and perimeter() to
calculate and return the area and perimeter of the rectangle.
⚫ Task 3: Object Interaction
Create a Library dass that contains a list of books and methods to add, remove, and list all books in the library.
• Task 4: Movie Class
Create a class Movie with attributes title, director, and rating. Add a method display_info() that prints the
movie's details and a method rate_movie (new_rating) to update the movie's rating.
• Task 5: Ticket Class (homework)
Define a class Ticket' with attributes event_name, date, and `price. Add methods
apply_discount(discount_percentage) to reduce the price by a given percentage and display_ticket()` to print
the ticket details including the final price after any discounts.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 5 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning