#!/usr/bin/env python

from __future__ import print_function
from builtins import range


class CreditCard:
	def __init__(self, customer, bank, acnt, limit):
		self._customer = customer
		self._bank     = bank
		self._account  = acnt
		self._limit    = limit
		self._balance  = 0.0
	
	def get_customer(self):
		return self._customer
	def get_bank(self):
		return self._bank
	def get_account(self):
		return self._account
	def get_limit(self):
		return self._limit
	def get_balance(self):
		return self._balance
	def charge(self, price):
		if self._balance+price>self._limit:
			return False
		else:
			self._blance+=price
			return True
	def make_payment(self, amount):
		self._blance -=amount

class PredatoryCreditCard(CreditCard):
	def __init__(self, customer, bank, acnt, limit, apr):
		super().__init__(customer, bank, acnt, limit)
		self._apr = apr
	def charge(self, price):
		success = super().charge(price)
		if not success:
			self._balance +=5
		return success
	def process_month(self):
		if self._balance > 0:
			monthly_factor = pow(1+self._apr, 1./12.)
			self._balance *= monthly_factor
			
if __name__=='__main__':
	cc = CreditCard('John Doe', '1st Bank','5391 0375 9387 5309', 1000)
	print('Bank of Credit Card: %s'%cc.get_bank())
	print('Credit Card hodler: %s'%cc.get_customer())
	print('Credit Card account: %s'%cc.get_account())
	print('Card limit: %d'%cc.get_limit())
	print('Current balance: %f'%cc.get_balance())
	pp = PredatoryCreditCard('John Doe', '1st Bank','5391 0375 9387 5309', 1000, 0.14)
	
	