For the petty cash Python program
For the petty cash program, need to add further attributes to the Account class (account's name, belong to which department, responsible person's name,  title, phone number, email address, etc). In addition, it needs to create a list of accounts. Let the user add new accounts to the list. Finally it needs to ask the user for the name of an account and then print the account's details. The program is below: 

#Petty Cash with added attributes.py
import shelve
import string
import datetime
class Transaction:
        DateOfTransaction = datetime.datetime(1900,1,1).today();
        TypeOfTransaction = "";
        FinalBalance = "";
        def __init__(self, TypeOfTransaction,FinalBalance):
                self.TypeOfTransaction =TypeOfTransaction;
                self.FinalBalance = FinalBalance;
        def showTransaction(self):
                if(self.TypeOfTransaction!="View transactions"):
                        print str(self.DateOfTransaction) + "    "+self.TypeOfTransaction + "         " +str(self.FinalBalance);
        def showRequest(self):
                print str(self.DateOfTransaction) + "    "+self.TypeOfTransaction + "         " +str(self.FinalBalance);
class Account:
        balance = 0.0;
        transactions = [];
        HistoricalDates = [];
        accountName = "";
        accountDepartment = "";
        responsiblePersonName = "";
        title = "";
        phonenumber = "";
        emailAddress = "";
        DateOfTransaction = datetime.datetime(1900,1,1).today();
        def __init__(self, balance,name,department ,person ,title ,phone ,email):
                self.balance = balance
                self.name = name
                self.department = department
                self.person = person
                self.title = title
                self.phone = phone
                self.email = email
                
        def deposit(self, amt,accountName ,accountDepartment ,responsiblePersonName ,title ,phonenumber ,emailAddress):
                self.balance = self.balance + amt
                this.accountName  = accountName
                this.accountDepartment   = accountDepartment
                this.responsiblePersonName = responsiblePersonName
                this.title = title
                this.phonenumber  = phonenumber;
                this.emailAddress = emailAddress;
                t =  Transaction("Deposit",self.balance);
                self.DateOfTransaction = datetime.datetime(1900,1,1).today();
                self.transactions.append(t);
                self.HistoricalDates.append(self.DateOfTransaction);
                print "balance:" + str(self.balance);
        def withdraw(self,amt):
                self.balance = self.balance - amt
                t =  Transaction("Withdraw",self.balance);
                self.DateOfTransaction = datetime.datetime(1900,1,1).today();
                self.HistoricalDates.append(self.DateOfTransaction);
                self.transactions.append(t);
                print "Balance:" + str(self.balance);
        def displayTransactions(self):
                self.DateOfTransaction = datetime.datetime(1900,1,1).today();
                t =  Transaction("View transactions",self.balance);
                self.transactions.append(t);
                self.HistoricalDates.append(self.DateOfTransaction);
                for key in self.transactions:
                        key.showTransaction();
        def viewRequests(self):
                print "Date of transaction" + "    "+"Type of transaction" + "         " +"Final balance";
                for key in self.transactions:
                        key.showRequest();
        def getbalance(self):
                return self.balance
 
foo = []
b = 1
i=-1;
name=""
balance=0;
department =""
person =""
title =""
phone =""
email =""
print "Welcome to the Petty Cash System!"
print "Primary account balance for an account:10000"
while(b != 5):
    i=-1;
    print "Please make a selection by typing one of the following options."
    print "1.Add Account #1"
    print "2.Deposit balance #: 2"
    print "3.Withdraw balance #: 3"
    print "4.Show transactions #: 4"
    print "5.Show requests #: 5"
    print "6.exit the Database type the #: 6"
    b = input(':')
    if b == 1:
        print "Enter the Account Name:"
        name = raw_input(':')
        print "Enter the Account Balance:"
        balance = int(raw_input(':'))
        print "Enter the Account Department:"
        department = raw_input(':')
        print "Enter the Account Responsible person:"
        person = raw_input(':')
        print "Enter the Account Title:"
        title = raw_input(':');
        print "Enter the Phone number:"
        phone = raw_input(':');
        print "Enter the Email:"
        email = raw_input(':');
        foo.append(Account(name ,balance,department ,person ,title ,phone ,email))
        print "Successfully added"
    if b == 2:
        print "Enter the Deposit:"
        n = raw_input(':')
        print "Enter the Account name:"
        name = raw_input(':')
        for key in foo:
           i = i+1;
           if key.accountName == name:
               foo[i].deposit(int(n));
           
    if b == 3:
        print "Enter the Withdraw:"
        n = raw_input(':')
        print "Enter the Account name:"
        name = raw_input(':')
        for key in foo:
           i = i+1;
           if key.accountName == name:
               foo[i].withdraw(int(n));
    if b == 4:
        print "Enter the Account name:"
        name = raw_input(':')
        for key in foo:
           i = i+1;
           if key.accountName == name:
               foo[i].displayTransactions();
    if b == 5:
        print "Enter the Account name:"
        name = raw_input(':')
        for key in foo:
           i = i+1;
           if key.accountName == name:
               foo[i].viewRequests();
    if b == 6:
        break;


For the petty cash Python program
===

For the petty cash program, need to add further attributes to the Account class (account's name, belong to which department, responsible person's name,  title, phone number, email address, etc). In addition, it needs to create a list of accounts. Let the user add new accounts to the list. Finally it needs to ask the user for the name of an account and then print the account's details. The program is below: 

#Petty Cash with added attributes.py
import shelve
import string
import datetime
class Transaction:
        DateOfTransaction = datetime.datetime(1900,1,1).today();
        TypeOfTransaction = "";
        FinalBalance = "";
        def __init__(self, TypeOfTransaction,FinalBalance):
                self.TypeOfTransaction =TypeOfTransaction;
                self.FinalBalance = FinalBalance;
        def showTransaction(self):
                if(self.TypeOfTransaction!="View transactions"):
                        print str(self.DateOfTransaction) + "    "+self.TypeOfTransaction + "         " +str(self.FinalBalance);
        def showRequest(self):
                print str(self.DateOfTransaction) + "    "+self.TypeOfTransaction + "         " +str(self.FinalBalance);
class Account:
        balance = 0.0;
        transactions = [];
        HistoricalDates = [];
        accountName = "";
        accountDepartment = "";
        responsiblePersonName = "";
        title = "";
        phonenumber = "";
        emailAddress = "";
        DateOfTransaction = datetime.datetime(1900,1,1).today();
        def __init__(self, balance,name,department ,person ,title ,phone ,email):
                self.balance = balance
                self.name = name
                self.department = department
                self.person = person
                self.title = title
                self.phone = phone
                self.email = email
                
        def deposit(self, amt,accountName ,accountDepartment ,responsiblePersonName ,title ,phonenumber ,emailAddress):
                self.balance = self.balance + amt
                this.accountName  = accountName
                this.accountDepartment   = accountDepartment
                this.responsiblePersonName = responsiblePersonName
                this.title = title
                this.phonenumber  = phonenumber;
                this.emailAddress = emailAddress;
                t =  Transaction("Deposit",self.balance);
                self.DateOfTransaction = datetime.datetime(1900,1,1).today();
                self.transactions.append(t);
                self.HistoricalDates.append(self.DateOfTransaction);
                print "balance:" + str(self.balance);
        def withdraw(self,amt):
                self.balance = self.balance - amt
                t =  Transaction("Withdraw",self.balance);
                self.DateOfTransaction = datetime.datetime(1900,1,1).today();
                self.HistoricalDates.append(self.DateOfTransaction);
                self.transactions.append(t);
                print "Balance:" + str(self.balance);
        def displayTransactions(self):
                self.DateOfTransaction = datetime.datetime(1900,1,1).today();
                t =  Transaction("View transactions",self.balance);
                self.transactions.append(t);
                self.HistoricalDates.append(self.DateOfTransaction);
                for key in self.transactions:
                        key.showTransaction();
        def viewRequests(self):
                print "Date of transaction" + "    "+"Type of transaction" + "         " +"Final balance";
                for key in self.transactions:
                        key.showRequest();
        def getbalance(self):
                return self.balance
 
foo = []
b = 1
i=-1;
name=""
balance=0;
department =""
person =""
title =""
phone =""
email =""
print "Welcome to the Petty Cash System!"
print "Primary account balance for an account:10000"
while(b != 5):
    i=-1;
    print "Please make a selection by typing one of the following options."
    print "1.Add Account #1"
    print "2.Deposit balance #: 2"
    print "3.Withdraw balance #: 3"
    print "4.Show transactions #: 4"
    print "5.Show requests #: 5"
    print "6.exit the Database type the #: 6"
    b = input(':')
    if b == 1:
        print "Enter the Account Name:"
        name = raw_input(':')
        print "Enter the Account Balance:"
        balance = int(raw_input(':'))
        print "Enter the Account Department:"
        department = raw_input(':')
        print "Enter the Account Responsible person:"
        person = raw_input(':')
        print "Enter the Account Title:"
        title = raw_input(':');
        print "Enter the Phone number:"
        phone = raw_input(':');
        print "Enter the Email:"
        email = raw_input(':');
        foo.append(Account(name ,balance,department ,person ,title ,phone ,email))
        print "Successfully added"
    if b == 2:
        print "Enter the Deposit:"
        n = raw_input(':')
        print "Enter the Account name:"
        name = raw_input(':')
        for key in foo:
           i = i+1;
           if key.accountName == name:
               foo[i].deposit(int(n));
           
    if b == 3:
        print "Enter the Withdraw:"
        n = raw_input(':')
        print "Enter the Account name:"
        name = raw_input(':')
        for key in foo:
           i = i+1;
           if key.accountName == name:
               foo[i].withdraw(int(n));
    if b == 4:
        print "Enter the Account name:"
        name = raw_input(':')
        for key in foo:
           i = i+1;
           if key.accountName == name:
               foo[i].displayTransactions();
    if b == 5:
        print "Enter the Account name:"
        name = raw_input(':')
        for key in foo:
           i = i+1;
           if key.accountName == name:
               foo[i].viewRequests();
    if b == 6:
        break;

