Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
72 views

Python Assignment

Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views

Python Assignment

Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 22

School of Engineering and Information Technology

ASSIGNMENT COVER SHEET

 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.

Except where I have indicated, the work I am submitting in this assignment is my


own work and has not been submitted for assessment in another unit.

This submission complies with Murdoch University policies regarding plagiarism,


cheating and collusion.

I have retained a copy of this assignment for my own records.


Page 2

Programming in Python Assignment Submission


ICT-100 @ Murdoch University
Dr Ashley Aitken Ashley.Aitken@RunningCode.Com.Au
v1.1 • 25/2/2024

Details

Student Name: Tashi Lhawang Dorji


Student Number: 35258614

Tutor Details: Fahad Afridi


Tutorial Details: Monday / 1:30

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

User Story 1 – Application Name

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.

a. Test – application displays the program's name when it starts.


b. Test – Application shows that the program has ended.

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")

print("Application has ended")

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

** Process exited - Return Code: 0 **


Press Enter to exit terminal

Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 5

User Story 2 – Exit

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.

a. Test – Enter “X” or “x” to get exit the application


b. Test – Enter any other key to continue to the menu

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")

answer = input("do you want to proceed to the menu? [Xx = Exit]")


if answer != "X" and answer != "x" :
print("Menu")

print("Application has ended")

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

** Process exited - Return Code: 0 **


Press Enter to exit terminal

Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 7

User Story 3 – Menu

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.

a. Test: Entering “X” or “x” should exit the application.


b. Test: Entering a valid menu option should perform the corresponding
action.
c. Test: Entering an invalid option should prompt to try again.

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.

Design a loop that presents a menu with options.

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

** Process exited - Return Code: 0 **


Press Enter to exit terminal

Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 9

Suggested Sprint 2

User Story 4 – Create

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.

a. Test: Enter account details and create a new saving account.


b. Test: Ensure account creation reflects in the system.

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.

Design a function to create a saving account,

taking user input for account details.

Store this information in a data structure such as a dictionary or list.

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

** Process exited - Return Code: 0 **


Press Enter to exit terminal

Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 11

User Story 5 – Print

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.

a. Test: Print details of a saving account.


b. Test: Print details of a credit account.

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.

Design a function to print the details of a bank account.


Iterate through the list of accounts and print each account's details.

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

print(f"Saving account '{account_name}' created with balance $


{initial_deposit}")

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

Application has ended

** Process exited - Return Code: 0 **


Press Enter to exit terminal

Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 13

User Story 6 – Credit

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.

a. Test: Enter account details and create a new credit account.


b. Test: Ensure account creation reflects in the system.

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.

Design a function to create a credit account,

taking user input for account details.

Store this information in a data structure such as a dictionary or list.

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

Application has ended

** Process exited - Return Code: 0 **


Press Enter to exit terminal

Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 15

User Story 7 – Deposit

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.

a. Test: Deposit money into a saving account.


b. Test: Deposit money into a credit account (reduces debt).

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

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")

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

** Process exited - Return Code: 0 **


Press Enter to exit terminal

Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 17

User Story 8 – Withdraw

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.

a. Test: Withdraw money from a saving account.


b. Test: Withdraw money from a credit account (increases debt).

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.

Design a function to withdraw money from 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 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

print(f"Saving account '{account_name}' created with balance $


{initial_deposit}")

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

Application has ended

** Process exited - Return Code: 0 **


Press Enter to exit terminal

Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006
Page 20

Retrospective (after all user stories)


Reflecting on your Agile Software Development and Python Programming.

What worked well?


1. Was able to make a simple banking application without too many hurdles.
2. I Was able to connect a few user stories together.

What could be improved?


1. Being able to know the errors that have been made needs to be more
understandable and not just give out which line has made the error

What didn’t work (or worked poorly)?


1. Was not able to connect few user stories.

Continuous Improvement Actions


Actions that can be taken in the future to improve all of the above include:

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:

My sincerest apologies for the delay in the submission of my assignment.

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.

Tashi Lhawang Dorji


35258614
09/06/2024

[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

Assignment Marking rubrics

Mark Name Stud # Allocated marks


Calculator
Overall Requirements – Test Definitions 15
Overall Analysis 15
Overall Design 15
Overall Coding – Including Comments 15
Overall Testing 15
Retrospective ((after all user stories)) 10
Demonstration 15
Total Mark 100

End

Electronic Assignment Submission and Marking Working Party - Final Report to Academic Council 17 May 2006

You might also like