Use the parent classes to the left to help you solve this problem. The first parent is the Person class with some very generic information. The second class, CardHolder, is the class for a credit card holder. Create the child class PlantinumClient. This class inherits all of the attributes of both parent classes. In addition, the child class has the attributes cash_back and rewards. cash_back should be set to 0.02 and rewards should be set to 0. Override the process_sale method so that 2% of each sale is added to rewards. Expected Output Declare an instance of the PlatinumClient class as shown below. platinum = PlatinumClient("Sarah", "101 Main Street", 123364) Your class should be able to execute the code below in the stated order and produce the given return values. Order Code Return Value 1 platinum.process_sale(100) N/A 2 print(platinum.rewards) 2 3 print(platinum.balance) 100 4 platinum.make_payment(50) N/A 5 print(platinum.balance) 50 6 print(platinum.get_info()) Sarah lives at 101 Main Street.     In Python Programming Please    # parent classes class Person:   def __init__(self, name, address):     self.name = name     self.address = address       def get_info(self):     return f"{self.name} lives at {self.address}."   class CardHolder:   def __init__(self, account_number):     self.account_number = account_number     self.balance = 0     self.credit_limit = 5000       def process_sale(self, price):     self.balance += price       def make_payment(self, amount):     self.balance -= amount     # declare child class here

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
icon
Related questions
Question

Use the parent classes to the left to help you solve this problem. The first parent is the Person class with some very generic information. The second class, CardHolder, is the class for a credit card holder. Create the child class PlantinumClient. This class inherits all of the attributes of both parent classes. In addition, the child class has the attributes cash_back and rewards. cash_back should be set to 0.02 and rewards should be set to 0. Override the process_sale method so that 2% of each sale is added to rewards. Expected Output Declare an instance of the PlatinumClient class as shown below.

platinum = PlatinumClient("Sarah", "101 Main Street", 123364)

Your class should be able to execute the code below in the stated order and produce the given return values.

Order

Code

Return Value

1

platinum.process_sale(100)

N/A

2

print(platinum.rewards)

2

3

print(platinum.balance)

100

4

platinum.make_payment(50)

N/A

5

print(platinum.balance)

50

6

print(platinum.get_info())

Sarah lives at 101 Main Street.

 

 

In Python Programming Please 

 

# parent classes

class Person:

  def __init__(self, name, address):

    self.name = name

    self.address = address

   

  def get_info(self):

    return f"{self.name} lives at {self.address}."

 

class CardHolder:

  def __init__(self, account_number):

    self.account_number = account_number

    self.balance = 0

    self.credit_limit = 5000

   

  def process_sale(self, price):

    self.balance += price

   

  def make_payment(self, amount):

    self.balance -= amount

   

# declare child class here

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education