<reponame>kburdick/currency_coverter<filename>currency_converter.py
'''
<NAME>
3/2/2017
Project #1 - A banking program to simulate currency conversions
Code that does currency conversions between US, EU, and CD
and applies a fee for the type of transaction choosen
'''

def main():

    end="go"
    
    while(end!="quit"):
        print('Currencies Available For Conversions Are: (1)US (2)EU and (3)CD')
        
        currentmoney=int(input('Enter the number for your Current Money: '))
        
        while(not(currentmoney==1 or currentmoney==2 or currentmoney==3)):
            print('Error, Please Enter a Valid Currency.')
            currentmoney=int(input('Enter the number for your Current Money: '))
            
        desiredmoney=int(input('Enter the number for your Desired Money: '))
        
        while(not(desiredmoney==1 or desiredmoney==2 or desiredmoney==3)or desiredmoney==currentmoney):
             print('Error, Please Enter a Valid Currency, or A Conversion is Required.')
             desiredmoney=int(input('Enter the number for your Desired Money: '))
             
        amount=float(input('Enter the Amount of money that you want to Convert: '))
        
        while(amount<=0):
            print('Error, Please Reenter a Valid Amount.')
            amount=float(input('Enter the Amount of Money you want to Convert: '))
            
        while(currentmoney!=desiredmoney and amount>0):
            amount=amount
            result=0
            
            if(currentmoney==1 and desiredmoney==2):
                result=(amount*.88)
                
            elif(currentmoney==1 and desiredmoney==3):
                result=(amount*1.29)
                
            elif(currentmoney==2 and desiredmoney==1):
                result=(amount*1.13)
                
            elif(currentmoney==2 and desiredmoney==3):
                result=(amount*1.46)
                
            elif(currentmoney==3 and desiredmoney==1):
                result=(amount*.78)
                
            elif(currentmoney==3 and desiredmoney==2):
                result=(amount*.69)
                
            transaction=int(input('Enter the number for the type of transction desired: (1)Check (2)Cash: '))
            while(transaction!=1 and transaction!=2):
                print('Please Reenter Valid Input')
                transaction=int(input('Enter the number for the type of transction desired: (1)Check (2)Cash: '))
                
            if(transaction==1):
                fee=0.01
                
            elif(transaction==2):
                fee=0.05
                
            totalfee=fee*amount
            
            if(currentmoney==1):
                currentmoney="US"
                
            elif(currentmoney==2):
                currentmoney="EU"
                
            elif(currentmoney==3):
                currentmoney="CD"
                
            if(desiredmoney==1):
                desiredmoney="US"
                
            elif(desiredmoney==2):
                desiredmoney="EU"
                
            elif(desiredmoney==3):
                desiredmoney="CD"
                
            print("Total Fee: "+str(totalfee))
            print("Current Money: "+str(amount)+" "+str(currentmoney))
            print("Received Money: "+str(result)+" "+str(desiredmoney))
            amount=0
            
        end=input('Enter "quit" to end program or nothing to continue: ')

main()



'''
<NAME>
3/2/2017
Project #1 - A banking program to simulate currency conversions
Code that does currency conversions between US, EU, and CD
and applies a fee for the type of transaction choosen
'''

def main():

    end="go"
    
    while(end!="quit"):
        print('Currencies Available For Conversions Are: (1)US (2)EU and (3)CD')
        
        currentmoney=int(input('Enter the number for your Current Money: '))
        
        while(not(currentmoney==1 or currentmoney==2 or currentmoney==3)):
            print('Error, Please Enter a Valid Currency.')
            currentmoney=int(input('Enter the number for your Current Money: '))
            
        desiredmoney=int(input('Enter the number for your Desired Money: '))
        
        while(not(desiredmoney==1 or desiredmoney==2 or desiredmoney==3)or desiredmoney==currentmoney):
             print('Error, Please Enter a Valid Currency, or A Conversion is Required.')
             desiredmoney=int(input('Enter the number for your Desired Money: '))
             
        amount=float(input('Enter the Amount of money that you want to Convert: '))
        
        while(amount<=0):
            print('Error, Please Reenter a Valid Amount.')
            amount=float(input('Enter the Amount of Money you want to Convert: '))
            
        while(currentmoney!=desiredmoney and amount>0):
            amount=amount
            result=0
            
            if(currentmoney==1 and desiredmoney==2):
                result=(amount*.88)
                
            elif(currentmoney==1 and desiredmoney==3):
                result=(amount*1.29)
                
            elif(currentmoney==2 and desiredmoney==1):
                result=(amount*1.13)
                
            elif(currentmoney==2 and desiredmoney==3):
                result=(amount*1.46)
                
            elif(currentmoney==3 and desiredmoney==1):
                result=(amount*.78)
                
            elif(currentmoney==3 and desiredmoney==2):
                result=(amount*.69)
                
            transaction=int(input('Enter the number for the type of transction desired: (1)Check (2)Cash: '))
            while(transaction!=1 and transaction!=2):
                print('Please Reenter Valid Input')
                transaction=int(input('Enter the number for the type of transction desired: (1)Check (2)Cash: '))
                
            if(transaction==1):
                fee=0.01
                
            elif(transaction==2):
                fee=0.05
                
            totalfee=fee*amount
            
            if(currentmoney==1):
                currentmoney="US"
                
            elif(currentmoney==2):
                currentmoney="EU"
                
            elif(currentmoney==3):
                currentmoney="CD"
                
            if(desiredmoney==1):
                desiredmoney="US"
                
            elif(desiredmoney==2):
                desiredmoney="EU"
                
            elif(desiredmoney==3):
                desiredmoney="CD"
                
            print("Total Fee: "+str(totalfee))
            print("Current Money: "+str(amount)+" "+str(currentmoney))
            print("Received Money: "+str(result)+" "+str(desiredmoney))
            amount=0
            
        end=input('Enter "quit" to end program or nothing to continue: ')

main()
<NAME>
 3/2/2017
 Project #1 - A banking program to simulate currency conversions
 Code that does currency conversions between US, EU, and CD
 and applies a fee for the type of transaction choosen