in python 1. Looking at the following class definition.  What is the name of the superclass? What is the name of the subclass?   class Rectangle(BBox):   2.For this question you will be writting a subclass to the superclass written below.   You are given class Account below that has appropriate attributes and behaviors.  You will write class CheckingAccount to be a subclass of class Account that has the added or changed features   Class CheckingAccount Has a static attribute called minBalance that is initialized to 500.00 Has a consturctor that accepts a persons name and initialbalance by parameter and initializes an Account correctly using that information Includes an overridden withdraw method that will not allow you to withdraw an amount that would put your current balance below the minimumBalance. You must use the static attribute for this method for full points.  It should adjust the balance appropriately if the withdraw can be made and should make no change to the balance if the withdraw can not be made.     class Account(object):     def __init__(self, name, balance):         self.__name = name         self.__balance = balance       def deposit(self, amount):         self.__balance += amount       def withdraw(self, amount):         if amount <= self.__balance:             self.__balance -= amount     def getBalance(self):         return self.__balance     def getName(self):         return self.__name

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

in python

1. Looking at the following class definition.  What is the name of the superclass? What is the name of the subclass?

 

class Rectangle(BBox):

 

2.For this question you will be writting a subclass to the superclass written below.  

You are given class Account below that has appropriate attributes and behaviors.  You will write class CheckingAccount to be a subclass of class Account that has the added or changed features

 

Class CheckingAccount

  • Has a static attribute called minBalance that is initialized to 500.00
  • Has a consturctor that accepts a persons name and initialbalance by parameter and initializes an Account correctly using that information
  • Includes an overridden withdraw method that will not allow you to withdraw an amount that would put your current balance below the minimumBalance. You must use the static attribute for this method for full points.  It should adjust the balance appropriately if the withdraw can be made and should make no change to the balance if the withdraw can not be made.  

 

class Account(object):

    def __init__(self, name, balance):
        self.__name = name
        self.__balance = balance

 

    def deposit(self, amount):
        self.__balance += amount

 

    def withdraw(self, amount):
        if amount <= self.__balance:
            self.__balance -= amount

    def getBalance(self):
        return self.__balance


    def getName(self):
        return self.__name

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar 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