Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

ITE3919 – Programming Essentials in Python  Mini Project

Type your personal information in the following table :

Student Name Student ID Programme / Class


De Vera Lehd Kenneth Dwaine
210028612 EG114701-2A
Gutierrez

You can use the online simulator https://edube.org/sandbox to complete this Mini Project.

Copy and paste your work into this MS word file InvBankSys_<<YourName>>.docx
(e.g. InvBankSys_ChanTaiMan.docx) and upload to Moodle.

Write Pseudo code of function 1 ("Converting Euro or USD to HKD") of the


Investment Banking System (IBS) in the following:
If command=1 do

Retrieve the user’s desired currency to be converted to HKD into variable (Curr)
Retrieve the amount to be converted into variable (am)
Initialize the variable(Euro_rate) as 8.02.
Initialize the variable(USD_rate) as

If variable (Curr) is Euro, use formula HKD=am*Euro_rate


Then print the amount to be converted into HKD

If variable (Curr) is USD, use formula HKD=am*USD_rate


Then print the amount to be converted into HKD
Complete the codes of functions 1, 2 and 3 of the Investment Banking System (IBS)
and paste all codes of the entire program to the following box:
"""

ITE3919 - Programming Essentials in Python (Mini Project)

Student Name: De Vera Lehd Kenneth Dwaine Gutierrez

Student No: 210028612

"""

EURO_RATE = 8.02

USD_RATE = 7.75

while True:

print("Welcome to IBS! Please choose one of the following functions")

print("1. Converting Euro or USD to HKD")

print("2. Calculating the minimum number of coins")

print("3. Calculating the total amount of principle and compound interest")

print("4. Quit")

command = input()

if command == "1":

# add your code of Function 1 here

Curr= input("Currency to be converted to HKD (Euro / USD):")

if Curr=="Euro":

am= float(input("Amount to be converted: "))

HKD=am*EURO_RATE

print(am,"Euro = ",HKD,"HKD")

elif Curr=="USD":
am= float(input("Amount to be converted: "))

HKD=am*USD_RATE

print(am,"USD = ",HKD,"HKD")

elif command =="2":

am=float(input('Input an amount:'))

print('The minimum numbers of coins for ', am, 'dollars are: ')

cal= am //10

re10= am%10

cal5=re10//5

re5=re10%5

cal2=re5//2

re2=re5%2

cal1=re2//1

print('10-dollar coin(s):',cal)

print('5-dollar coin(s):',cal5)

print('2-dollar coin(s):',cal2)

print("1-dollar coin(s):",cal1)

elif command =="3":

p=float(input('Input principle:'))

rate=float(input('Input rate:'))

y=float(input('input number of years compound:'))

i=1

while i<=y:
p=p*(1+rate)

i += 1

print("The total amount of principle and compound interest:",p)

elif command =="4":

print("Thanks for using IBS! Bye!")

break

You might also like