Python Assignment
Python Assignment
Please complete and insert this form as the first page of EACH electronic assignment.
Submit the assignment with attached coversheet electronically as per the instructions
in the Assignment Question sheet.
Please make sure you keep a copy of the assignment.
Student Details
Surname Dorji Given name Tashi Lhawang
Student Number 35258614 Email tashilhawnagdorji@yahoo.com
Assignment details
Unit name Transition to IT Unit Code ICT100
Unit Coordinator Fahad Afridi Tutor/Tutorial time 1:30
Due date/time 30/05/2024 Submission date 09/06/2024
Assignment title Programming in Python Assignment
Other information
All forms of plagiarism, cheating and unauthorized collusion are regarded seriously by
the University and could result in penalties including failure in the unit and possible
exclusion from the University. If in doubt, please contact the Unit Coordinator.
Student’s Declaration
Please double click on all the check boxes.
Details
Assignment
Please see the ICT-100 Agile Programming in Python Assignment document for
full details, including user stories, and some information to help with the agile
software development process.
Sprints
We highly recommend you complete the assignment in a few short sprints (e.g.
work sessions), with two or three stories per sprint, as suggested in this document.
Assignment Process
1. Change the names and details above,
2. For each user story:
a. Document your Test,
b. Document your Analysis,
c. Document your Design,
d. Document your Coding, and
e. Document your Testing.
3. Complete a Retrospective,
4. Complete the Assignment Submission section, and
5. Upload this document to your Learning Management System.
Replace the XXX throughout the document with your work. There is no “right
way” for any of the answers but just do what you need to achieve the required
result.
Please Note: Although there are a lot of pages and sections for each user
story, the work required for each is relatively small. Completing the work in
this way is doing agile software development.
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 3
Suggested Sprint 1
Requirement
As a User
I want to be able to run the application and see its name and when it ends
So that I know I am using the correct application, and I can tell when it ends.
Include a description of how you will test this user story. You will most likely
have more than one test per use story.
Problem Analysis
Analyse the user story and document your understanding of the user story. You
should contact that Product Owner (PO) if there is anything you need to
understand further.
The user should be able to see the program name when the application starts and
also show that the program has ended.
Solution Design
Design and document your solution for the user story in terms of the program
shape and the code structures you will use to implement the design, e.g. insert a
Word drawing or photos of your design.
The application should be able to show the user the title of the program and show
that the program has ended.
Coding
Include a copy of your final Python code once all your testing is complete. This
should be copied and pasted from your development environment of the file you
use to save your program.
#Banking Application
print("Banking")
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 4
Testing
Include the output (e.g. a screenshot or copy and paste) of the successful
completion of each of your tests to demonstrate you have completed the user
story.
ICT Banking
Application has ended
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 5
Requirement
As a User
I want to be able to choose whether to do something or exit the application
So that I can do something specific or exit.
Include a description of how you will test this user story. You will most likely
have more than one test per use story.
Problem Analysis
Analyse the user story and document your understanding of the user story. You
should contact that Product Owner (PO) if there is anything you need to
understand further.
The user should be able to exit the program when inputting “X” or “x” and any
other keys to continue with the menu.
Solution Design
Design and document your solution for the user story in terms of the program
shape and the code structures you will use to implement the design, e.g. insert a
Word drawing or photos of your design.
Design it so that the user has a choice to exit the program or continue on with the
banking services.
Coding
Include a copy of your final Python code once all your testing is complete. This
should be copied and pasted from your development environment of the file you
use to save your program.
#Banking Application
print("Banking")
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 6
Testing
Include the output (e.g. a screenshot or copy and paste) of the successful
completion of each of your tests to demonstrate you have completed the user
story.
Banking
do you want to proceed to the menu? [Xx = Exit]
y
Menu
Application has ended
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 7
Requirement
As a User
I want to be able to repeatedly choose what I do in the application (including
to exit)
So that I can do continue to do something or just exit.
Include a description of how you will test this user story. You will most likely
have more than one test per use story.
Problem Analysis
Analyse the user story and document your understanding of the user story. You
should contact that Product Owner (PO) if there is anything you need to
understand further.
The user should be able to interact with a menu that allows them to choose
different actions or exit the application. This involves presenting a menu
repeatedly until the user decides to exit by entering “X” or “x”.
Solution Design
Design and document your solution for the user story in terms of the program
shape and the code structures you will use to implement the design, e.g. insert a
Word drawing or photos of your design.
Based on the user's input, either perform the selected action or exit.
Use a while loop to keep showing the menu until the user chooses to exit.
Coding
Include a copy of your final Python code once all your testing is complete. This
should be copied and pasted from your development environment of the file you
use to save your program.
# Banking Application
def show_menu():
print("Menu")
print("1. Avail banking services")
print("2. Exit")
print("3. Invalid choice. Please try again")
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 8
print("Banking")
while True:
show_menu()
choice = input("Enter your choice (1, 2, or 3): ")
if choice == "1":
print("Banking services")
elif choice == "2":
print("Application has ended")
break
else:
print("Invalid choice. Please try again")
Testing
Include the output (e.g. a screenshot or copy and paste) of the successful
completion of each of your tests to demonstrate you have completed the user
story.
Banking
Menu
1. Avail banking services
2. Exit
3. Invalid choice. Please try again
Enter your choice (1, 2, or 3):
1
Banking services
Menu
1. Avail banking services
2. Exit
3. Invalid choice. Please try again
Enter your choice (1, 2, or 3):
1
Banking services
Menu
1. Avail banking services
2. Exit
3. Invalid choice. Please try again
Enter your choice (1, 2, or 3):
2
Application has ended
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 9
Suggested Sprint 2
Requirement
As a Customer
I want to be able to create a Saving Account
So I can save my money and get interest.
Include a description of how you will test this user story. You will most likely
have more than one test per use story.
Problem Analysis
Analyse the user story and document your understanding of the user story. You
should contact that Product Owner (PO) if there is anything you need to
understand further.
The user should be able to input details to create a saving account. The program
should confirm the creation and store the account information.
Solution Design
Design and document your solution for the user story in terms of the program
shape and the code structures you will use to implement the design, e.g. insert a
Word drawing or photos of your design.
Coding
Include a copy of your final Python code once all your testing is complete. This
should be copied and pasted from your development environment of the file you
use to save your program.
#Banking Application
accounts = []
def create_saving_account():
account_name = input("Enter account name: ")
initial_deposit = float(input("Enter initial deposit amount: "))
account = {
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 10
"type": "Saving",
"name": account_name,
"balance": initial_deposit
}
accounts.append(account)
print(f"Saving account '{account_name}' created with balance $
{initial_deposit}")
print("Banking")
create_saving_account()
print("Application has ended")
Testing
Include the output (e.g. a screenshot or copy and paste) of the successful
completion of each of your tests to demonstrate you have completed the user
story.
Banking
Enter account name:
jin
Enter initial deposit amount:
10000
Saving account 'jin' created with balance $10000.0
Application has ended
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 11
Requirement
As a Customer
I want to be able to print out the details of my bank account
So that I know what type of account I have and the current balance.
Include a description of how you will test this user story. You will most likely
have more than one test per use story.
Problem Analysis
Analyse the user story and document your understanding of the user story. You
should contact that Product Owner (PO) if there is anything you need to
understand further.
The user should be able to print out the details of their bank account. This includes
the account type, account name, and current balance.
Solution Design
Design and document your solution for the user story in terms of the program
shape and the code structures you will use to implement the design, e.g. insert a
Word drawing or photos of your design.
Coding
Include a copy of your final Python code once all your testing is complete. This
should be copied and pasted from your development environment of the file you
use to save your program.
# Banking Application
accounts = []
def create_saving_account():
account_name = input("Enter account name: ")
initial_deposit = float(input("Enter initial deposit amount: "))
account = {
"type": "Saving",
"name": account_name,
"balance": initial_deposit
}
accounts.append(account)
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 12
def print_account_details():
for account in accounts:
print(f"Account Type: {account['type']}")
print(f"Account Name: {account['name']}")
print(f"Balance: ${account['balance']}\n")
print("Banking")
create_saving_account()
print_account_details()
print("Application has ended")
Testing
Include the output (e.g. a screenshot or copy and paste) of the successful
completion of each of your tests to demonstrate you have completed the user
story.
Banking
Enter account name:
jin
Enter initial deposit amount:
5000
Saving account 'jin' created with balance $5000.0
Account Type: Saving
Account Name: jin
Balance: $5000.0
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 13
Requirement
As a Customer
I want to be able to create a Credit Account
So I can spend more money than I have.
Include a description of how you will test this user story. You will most likely
have more than one test per use story.
Problem Analysis
Analyse the user story and document your understanding of the user story. You
should contact that Product Owner (PO) if there is anything you need to
understand further.
The user should be able to input details to create a credit account. The program
should confirm the creation and store the account information.
Solution Design
Design and document your solution for the user story in terms of the program
shape and the code structures you will use to implement the design, e.g. insert a
Word drawing or photos of your design.
Coding
Include a copy of your final Python code once all your testing is complete. This
should be copied and pasted from your development environment of the file you
use to save your program.
# Banking Application
accounts = []
def create_credit_account():
account_name = input("Enter account name: ")
credit_limit = float(input("Enter credit limit amount: "))
account = {
"type": "Credit",
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 14
"name": account_name,
"balance": -credit_limit # Negative balance indicating credit limit
}
accounts.append(account)
print(f"Credit account '{account_name}' created with credit limit $
{credit_limit}")
def print_account_details():
for account in accounts:
print(f"Account Type: {account['type']}")
print(f"Account Name: {account['name']}")
print(f"Balance: ${account['balance']}\n")
print("Banking")
create_credit_account()
print_account_details()
print("Application has ended")
Testing
Include the output (e.g. a screenshot or copy and paste) of the successful
completion of each of your tests to demonstrate you have completed the user
story.
Banking
Enter account name:
jin
Enter credit limit amount:
9000
Credit account 'jin' created with credit limit $9000.0
Account Type: Credit
Account Name: jin
Balance: $-9000.0
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 15
Requirement
As a Customer
I want to be able to Deposit money to my bank account
So that I can use my bank account.
Include a description of how you will test this user story. You will most likely
have more than one test per use story.
Problem Analysis
Analyse the user story and document your understanding of the user story. You
should contact that Product Owner (PO) if there is anything you need to
understand further.
The user should be able to deposit money into their bank account. The program
should update the account balance accordingly.
Solution Design
Design and document your solution for the user story in terms of the program
shape and the code structures you will use to implement the design, e.g. insert a
Word drawing or photos of your design.
Design a function to deposit money into an account by searching for the account
and updating its balance.
Coding
Include a copy of your final Python code once all your testing is complete. This
should be copied and pasted from your development environment of the file you
use to save your program.
# Banking Application
accounts = []
def deposit_money():
account_name = input("Enter account name: ")
amount = float(input("Enter deposit amount: "))
for account in accounts:
if account['name'] == account_name:
account['balance'] += amount
print(f"${amount} deposited to {account_name}. New balance: $
{account['balance']}")
break
else:
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 16
def print_account_details():
for account in accounts:
print(f"Account Type: {account['type']}")
print(f"Account Name: {account['name']}")
print(f"Balance: ${account['balance']}\n")
print("Banking")
deposit_money()
print_account_details()
print("Application has ended")
Testing
Include the output (e.g. a screenshot or copy and paste) of the successful
completion of each of your tests to demonstrate you have completed the user
story.
Banking
Enter account name:
jin
Enter deposit amount:
90000
Account not found
Application has ended
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 17
Requirement
As a Customer
I want to be able to Withdraw money from my bank account
So that I can use my bank account.
Include a description of how you will test this user story. You will most likely
have more than one test per use story.
Problem Analysis
Analyse the user story and document your understanding of the user story. You
should contact that Product Owner (PO) if there is anything you need to
understand further.
The user should be able to withdraw money from their bank account. The program
should update the account balance accordingly.
Solution Design
Design and document your solution for the user story in terms of the program
shape and the code structures you will use to implement the design, e.g. insert a
Word drawing or photos of your design.
Coding
Include a copy of your final Python code once all your testing is complete. This
should be copied and pasted from your development environment of the file you
use to save your program.
# Banking Application
accounts = []
def create_saving_account():
account_name = input("Enter account name: ")
initial_deposit = float(input("Enter initial deposit amount: "))
account = {
"type": "Saving",
"name": account_name,
"balance": initial_deposit
}
accounts.append(account)
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 18
def withdraw_money():
account_name = input("Enter account name: ")
amount = float(input("Enter withdrawal amount: "))
for account in accounts:
if account['name'] == account_name:
if account['type'] == 'Saving' and account['balance'] >= amount:
account['balance'] -= amount
print(f"${amount} withdrawn from {account_name}. New balance: $
{account['balance']}")
elif account['type'] == 'Credit':
account['balance'] -= amount
print(f"${amount} withdrawn from {account_name}. New balance: $
{account['balance']}")
else:
print("Insufficient funds")
break
else:
print("Account not found")
def print_account_details():
for account in accounts:
print(f"Account Type: {account['type']}")
print(f"Account Name: {account['name']}")
print(f"Balance: ${account['balance']}\n")
print("Banking")
create_saving_account()
withdraw_money()
print_account_details()
print("Application has ended")
Testing
Include the output (e.g. a screenshot or copy and paste) of the successful
completion of each of your tests to demonstrate you have completed the user
story.
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 19
Banking
Enter account name:
90000
Enter initial deposit amount:
90000
Saving account '90000' created with balance $90000.0
Enter account name:
10000
Enter withdrawal amount:
30000
Account not found
Account Type: Saving
Account Name: 90000
Balance: $90000.0
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 20
1. Produce the errors made clearly so as to know what has really went wrong
and be able to proceed to making a much better and working code for the
program.
Other comments
None.
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 21
Assignment Submission
Submission Details
Date: 09/06/2024
Time: 4::30
Submission Comment:
Plagiarism Declaration
I declare that the work submitted for this assignment is my own work, completed
on my own, and without the direct assistance of any other person.
I also declare that I have not copied the work of any other student or person,
whether known to me or not. I understand there are penalties for plagiarism.
[By typing your name and specifying the date you are formally and officially
signing this document.]
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 22
End
Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006