Module phone_bill :: Class Phone_bill
[hide private]
[frames] | no frames]

Class Phone_bill

source code

object --+
         |
        Phone_bill

The class PhoneBill represents customers' phone bills. Each phone bill object is associated with a number of phone calls whose prices combine to form the total cost of the phone bill.

Instance Methods [hide private]
 
__init__(self, customer)
Creates a new phone bill with the given customer and no calls made yet.
source code
 
add_call(self, new_call)
Adds a new phone call to this phone bill.
source code
 
get_total_price(self)
Returns the price total of this phone bill, i.e., the sum of the prices of the phone calls added to this bill.
source code
 
get_breakdown(self)
Returns an item-by-item listing of the phone calls included in the bill.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, customer)
(Constructor)

source code 

Creates a new phone bill with the given customer and no calls made yet.

Parameters:
  • customer - a customer name
Overrides: object.__init__

add_call(self, new_call)

source code 

Adds a new phone call to this phone bill.

Parameters:
  • new_call - a phone call made by the customer whose bill this is

get_total_price(self)

source code 

Returns the price total of this phone bill, i.e., the sum of the prices of the phone calls added to this bill.

Returns:
call price sum

get_breakdown(self)

source code 

Returns an item-by-item listing of the phone calls included in the bill.

Returns:
a multi-line string listing the details of this phone bill