SlideShare a Scribd company logo
1 of 16
New folder/Assignment _Sem2_2013.docx
ITECH1000/5000 Programming 1
School of Science, Information Technology and Engineering
Assignment 2Semester 2, 2013
Introduction
This assignment requires you to work with some lists and to
explore some common algorithms. You will be working with a
list of bank records which contain details of individual bank
customers and their accounts.
You will be required to provide a hardcopy of a written report
(a word document) with some of your answers. You will also be
required to hand the whole assignment (both code and reports)
in electronic form.
Task A
Download the files bank.txt and assignment2.py. The file
bank.txt is the input file for the program. It consists of a
number of lines of text, each with five fields. These fields are:
· The customer’s first name
· The customer’s last name
· The customer’s account number
· The account type (savings, credit or cheque)
· The account balance
Assignment2.py already has some functionality added – ignore
that for the moment.
For each of the following functions provide the expected inputs,
outputs and pseudocode in your report (note: you will probably
find the assignment easier if you do this BEFORE you do your
coding)
a) Write a new function (called readInputFileIntoList) which
will read the file bank.txt and place individual customer records
into a list (effectively a ‘list of lists’). The function should NOT
take the bank list as a parameter. It should return the bank list
via its return statement.
You may not assume that you know how many records are in the
input file – it must work for any number of lines.
For each line in the input file you should create an individual
list with five elements (listed above). Use the ‘split’ function to
help you with this. Once you have created this list, add it to the
bank list. The result of executing readInputFileInfoList should
be a list of bank records – one for each line in the file.
b) Write a function called ‘printIndividualRecord’. It should
take a list (corresponding to a single bank record) as a
parameter. If the record is
Bruce Willis 123313 savings 405.00
the function should print out the details of the record in the
following format
Bruce Willis has a savings account with account no: 123313
There is $405.00 in this account.
c) Write a function called ‘printAllRecords’, which calls
printIndividualRecord for each record in the bank list. It should
take the bank list as a parameter.
Task B
Examine the functions already authored in assignment2.py.
· swap
· maxListByItem
In the code, write a high-level description of what each of these
functions is intended to do as a comment above the function
code. This description should be no longer than five lines.
Marks will be awarded according to how well your response
reflects your understanding.
Task C
Examine the function ‘sortListUsingSelectionSort’ that has been
written in assignment2.py. This function is not complete. Use
the functions from task B to complete the implementation of
this function. Note – it should not be necessary to move (change
the order of) or delete the code that is already there. When
complete the function should have sorted the list in descending
order (biggest item first).
In the code (not the report) add a brief comment (1 or 2 lines
maximum) to each line to explain how the line contributes to
the implementation of the selection sort.
Also add a comment above the function to describe to someone
else who might want to use it at a later time. This comment
should be no longer than 5 lines.
Marks for the comments will be awarded according to how well
they reflect your understanding of the code.
Task D
Write functions to perform the following tasks. Each function
should be properly commented, use well-chosen identifier
names and have appropriate parameters and any other good
programming practices.
1) Write a function, called ‘sortAccountTypeLastName’ that
sorts the list by the account type. If account types are the same,
sort the list by last name. You can use either insertion sort or
bubble sort for this function. The original list should be passed
in as a parameter. This list should be copied into a second list
which should be sorted and returned by the function.
2) Write a function, called ‘printListToFile’, that will write the
details of a list to a file called ‘bank.out’. The format for the
output file should be the same as the input file. In other words,
it should be possible to use ‘bank.out’ as input to the program.
3) Write a function, called ‘addInterest’ that charges 10%
interest to each account with a negative account balance. Other
account balances should remain unchanged.
4) Write a function, called ‘binarySearch’, implements a binary
search. This function should take three parameters.
a. the target (the value that you are looking for)
b. the field being searched(eg account type, account balance
etc.).
c. the list itself
If the target is found, return the index value where it was found.
Otherwise the function should return -1.
5) Write a function, called ‘sortAnyTwoFields’ which performs
a similar task to ‘sortAccountTypeLastName’ but which is more
general. This function should have three parameters
a. field1 – the first field to be sorted on
b. field2 – the field to be sorted on if the values of field1 are
equal
c. bList – the bank list
The original list should be passed in as a parameter. This list
should be copied into a second list which should be sorted and
returned by the function. For example
sortAnyTwoFields (CUSTOMER_LAST_NAME,
CUSTOMER_ACCOUNT_BALANCE, bankList)
will sort by the customer’s last name. If the last names are the
same, then the list is sorted by account balance.
Assignment 2
Mark Sheet - ITECH1000-5000
Student Name: ____________________ Id: _____________
Marker: _______
Task
Comments
Mark
Max
Section A
6
readInputFileIntoList
2
printIndividualRecord
1
printAllRecords
1
documentation
2
Section B
2
documentation
2
Section C
3
2 for functionality, 1 for comments
3
Section D
9
1)
sortAccountTypeLastName
2
2)
printListToFile
2
3)
addInterest
2
4)
binarySearch
2
5)
sortTwoFields
1
Deductions
comments missing, inappropriate names, failure to use defined
methods to access objects
max 6
Total(20)
20
CRICOS Provider No. 00103D
Page 6 of 6
New folder/assignment2.py
import string
CUSTOMER_FIRST_NAME = 0
CUSTOMER_LAST_NAME = 1
CUSTOMER_ACCOUNT_NO = 2
CUSTOMER_ACCOUNT_TYPE = 3
CUSTOMER_ACCOUNT_BALANCE = 4
def readInputFileIntoList ():
print "readInputFileIntoList is yet to be implemented"
def printIndividualRecord (record):
print "printIndividualRecord yet to be implemented"
def printAllRecords (bList):
print "printAllRecords yet to be implemented"
def swap (pos1, pos2, bList):
temp = bList[pos1]
bList[pos1] = bList[pos2]
bList[pos2] = temp
def maxListByItem (item, bList):
if len(bList) == 0:
print "no items in list"
return 0
maximum = bList[0][item]
count = 0
pos = 0
for record in bList:
if maximum < record[item]:
maximum = record[item]
pos = count
count = count + 1
return pos
def sortListUsingSelectionSort (item, bList):
sortedList = list(bList)
pos = 0
for index in range(len(sortedList)):
#insert code here
return sortedList
def sortAccountTypeLastName (bList):
print "sortAccountTypeLastName yet to be implemented"
def printListToFile (bList):
print "printListToFile yet to be implemented"
def addTenPercent (bList):
print "addTenPercent is yet to be implemented"
def binarySearch (target, item, bList):
print "binarySearch yet to be implemented"
def sortAnyTwoFields (field1, field2, bList):
print "sortAnyTwoFields yet to be implemented"
def main ():
bankList = readInputFileIntoList ()
printAllRecords (bankList)
sortedList = sortListUsingSelectionSort
(CUSTOMER_ACCOUNT_NO, bankList)
printAllRecords (sortedList)
pos = binarySearch ("Phili", CUSTOMER_FIRST_NAME,
sortedList)
if (pos == -1):
print "Item not found"
else:
printIndividualRecord (sortedList[pos])
addTenPercent (bankList)
sortedList = sortAccountTypeLastName (bankList)
printAllRecords (sortedList)
printListToFile (sortedList)
main ()
New folder/bank.txt
Phil Smith 321971 cheque 420.90
Eldar Hajilarov 567834 savings 670.25
Sasa Ivkovic 452312 credit 190.80
Charlynn Miller 823848 cheque 23.49
Adil Bagirov 723124 credit -873.56
Ewan Barker 812840 cheque -22.45
David Gao 452353 credit 512.90
Shannon Bell 123948 credit 2090.45
Phil Smith 542321 credit 657.89
Marcello Bertoli 672314 savings 234.76
Alex Kruger 812043 cheque -900.82
Leo Brunelle 823843 savings 1293.87
Grant Meredith 380284 savings 438.00
Peter Vamplew 928483 cheque -658.80
Glenn Stevens 284934 credit 1892.00
Jason Giri 453920 cheque 298.00
Peter Martin 659330 savings 902.89
Kylie Turville 349583 credit 800.78
Chris Turville 568373 credit -900.00
Phil Smith 292871 savings 60.00
Daniel Morales 87383 cheque 288.00
Guillermo PinedaVillacencio 898989 cheque 567.44
Shamsheer Syed 837437 credit 452.33
Long Jia 283923 savings 190.00
David Stratton 342873 credit 890.00
Greg Simmons 382834 savings -899.00
Musa Mammadov 990990 credit -900.00
Elizabeth Matuschka 700638 savings 200.00
Kaye Lewis 891212 savings 344.00
Frank Deluca 672314 credit 500.00
David Gao 568933 credit -400.00
Brian Firth 828392 savings -450.00
Evan Dekker 434023 cheque -900.00
Sally Firman 932983 cheque -730.00
Rosemary Torney 485374 savings 898.00
Marijke Groothuis 943823 credit 890.00
Assignment 3 instructions
Objective of the assignment: The objective of this assignment
is to allow you to demonstrate your knowledge of the steps
required to recruit and staff for an important segment of the
workplace and to demonstrate your strategic skills to the CEO.
You will share some of the essential strategic and
administrative steps for this important function of Human
Resources and will include metrics for which to evaluate the
recruitment and selection approach that will be implemented.
The situation: Suppose that you are the new HR Director at HSS
(the case study presented in our Course Resources under
modules) and you have already made a presentation to the CEO
and the Board of Directors on the need for HR planning and and
enhanced strategic role that HR must play in the organization.
After that presentation, and having read the research on
managing human resources strategically that you have presented
(assignment 2 literature review), the CEO confides that she has
been thinking about how the senior staff in the organization are
recruited and selected. As a result, she has asked you to propose
new recruitment and selection methods for the senior level
employees.
Deliverable:
The CEO's directive to you is to prepare a short (approximately
five-page double spaced) proposal that includes at the least:
1. A cover memo to the CEO providing an overview of the task
assigned and a summary of your proposal
2. A description of at least three recruitment approaches that
could be considered
3. A description of at least three selection approaches that
could be considered
4. A cost/benefit analysis and comparison of the approaches of
both the recruitment and selection approached
5. Metrics the organization could use to evaluate the
effectiveness of the on-going recruitment and selection of
senior level employees. Propose at least three metrics for the
evaluation (include the time frame for your evaluation period
such as six months after entry into the position).
6. Your recommended approach and your
arguments/justification to defend your choices.
7. A conclusion section that includes a summary of the
approaches recommended, the benefits and any other aspects to
the proposal you want to highlight.
Notes: Use topic headings to organization your presentation,
include in-text citations for statements of fact, and provide a
reference page if in text citations are used in the proposal, use
professional level language and writing.

More Related Content

Similar to New folderAssignment _Sem2_2013.docxITECH10005000 Programmin.docx

Coit11237 assignment 2 specifications
Coit11237 assignment 2 specificationsCoit11237 assignment 2 specifications
Coit11237 assignment 2 specificationsNicole Valerio
 
C-Programming Chapter 1 Fundamentals of C.ppt
C-Programming Chapter 1 Fundamentals of C.pptC-Programming Chapter 1 Fundamentals of C.ppt
C-Programming Chapter 1 Fundamentals of C.pptMehul Desai
 
LWPRG2 Chapter 5.ppt
LWPRG2 Chapter 5.pptLWPRG2 Chapter 5.ppt
LWPRG2 Chapter 5.pptMadeeshShaik
 
CIS 336 STUDY Introduction Education--cis336study.com
CIS 336 STUDY Introduction Education--cis336study.comCIS 336 STUDY Introduction Education--cis336study.com
CIS 336 STUDY Introduction Education--cis336study.comclaric262
 
Class 12 computer sample paper with answers
Class 12 computer sample paper with answersClass 12 computer sample paper with answers
Class 12 computer sample paper with answersdebarghyamukherjee60
 
Project 3 instructions
Project 3    instructionsProject 3    instructions
Project 3 instructionsIIUM
 
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdf
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdfScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdf
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdfalokindustries1
 
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docxCOMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docxdonnajames55
 
C programming session 09
C programming session 09C programming session 09
C programming session 09Dushmanta Nath
 
Computer science ms
Computer science msComputer science ms
Computer science msB Bhuvanesh
 
PT1420 File Access and Visual Basic .docx
PT1420 File Access and Visual Basic                      .docxPT1420 File Access and Visual Basic                      .docx
PT1420 File Access and Visual Basic .docxamrit47
 
MaxTECH Technical Training - Maximo Custom Audit Solution
MaxTECH Technical Training - Maximo Custom Audit SolutionMaxTECH Technical Training - Maximo Custom Audit Solution
MaxTECH Technical Training - Maximo Custom Audit SolutionHelen Fisher
 
Mr20 enus 03-Report Design in Management Reporter 2.0 for Microsoft Dynamics®...
Mr20 enus 03-Report Design in Management Reporter 2.0 for Microsoft Dynamics®...Mr20 enus 03-Report Design in Management Reporter 2.0 for Microsoft Dynamics®...
Mr20 enus 03-Report Design in Management Reporter 2.0 for Microsoft Dynamics®...Sami JAMMALI
 

Similar to New folderAssignment _Sem2_2013.docxITECH10005000 Programmin.docx (14)

Coit11237 assignment 2 specifications
Coit11237 assignment 2 specificationsCoit11237 assignment 2 specifications
Coit11237 assignment 2 specifications
 
Fahri tugas cloud1
Fahri tugas cloud1Fahri tugas cloud1
Fahri tugas cloud1
 
C-Programming Chapter 1 Fundamentals of C.ppt
C-Programming Chapter 1 Fundamentals of C.pptC-Programming Chapter 1 Fundamentals of C.ppt
C-Programming Chapter 1 Fundamentals of C.ppt
 
LWPRG2 Chapter 5.ppt
LWPRG2 Chapter 5.pptLWPRG2 Chapter 5.ppt
LWPRG2 Chapter 5.ppt
 
CIS 336 STUDY Introduction Education--cis336study.com
CIS 336 STUDY Introduction Education--cis336study.comCIS 336 STUDY Introduction Education--cis336study.com
CIS 336 STUDY Introduction Education--cis336study.com
 
Class 12 computer sample paper with answers
Class 12 computer sample paper with answersClass 12 computer sample paper with answers
Class 12 computer sample paper with answers
 
Project 3 instructions
Project 3    instructionsProject 3    instructions
Project 3 instructions
 
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdf
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdfScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdf
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdf
 
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docxCOMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
 
C programming session 09
C programming session 09C programming session 09
C programming session 09
 
Computer science ms
Computer science msComputer science ms
Computer science ms
 
PT1420 File Access and Visual Basic .docx
PT1420 File Access and Visual Basic                      .docxPT1420 File Access and Visual Basic                      .docx
PT1420 File Access and Visual Basic .docx
 
MaxTECH Technical Training - Maximo Custom Audit Solution
MaxTECH Technical Training - Maximo Custom Audit SolutionMaxTECH Technical Training - Maximo Custom Audit Solution
MaxTECH Technical Training - Maximo Custom Audit Solution
 
Mr20 enus 03-Report Design in Management Reporter 2.0 for Microsoft Dynamics®...
Mr20 enus 03-Report Design in Management Reporter 2.0 for Microsoft Dynamics®...Mr20 enus 03-Report Design in Management Reporter 2.0 for Microsoft Dynamics®...
Mr20 enus 03-Report Design in Management Reporter 2.0 for Microsoft Dynamics®...
 

More from henrymartin15260

NT2580 Week 1 Understanding IT Infrastructure Security An.docx
NT2580 Week 1 Understanding IT Infrastructure Security An.docxNT2580 Week 1 Understanding IT Infrastructure Security An.docx
NT2580 Week 1 Understanding IT Infrastructure Security An.docxhenrymartin15260
 
NTC362 Week 3OSI Model, Switching Systems, Network Channel Pr.docx
NTC362   Week 3OSI Model, Switching Systems, Network Channel Pr.docxNTC362   Week 3OSI Model, Switching Systems, Network Channel Pr.docx
NTC362 Week 3OSI Model, Switching Systems, Network Channel Pr.docxhenrymartin15260
 
NT2580 Week 4 Hardening a NetworkAnalysis 4.2Availability, In.docx
NT2580 Week 4 Hardening a NetworkAnalysis 4.2Availability, In.docxNT2580 Week 4 Hardening a NetworkAnalysis 4.2Availability, In.docx
NT2580 Week 4 Hardening a NetworkAnalysis 4.2Availability, In.docxhenrymartin15260
 
NTNU, May 2009 ntnu.nocbm 1 LEARNING AND MEMORY .docx
NTNU, May 2009 ntnu.nocbm 1 LEARNING AND MEMORY .docxNTNU, May 2009 ntnu.nocbm 1 LEARNING AND MEMORY .docx
NTNU, May 2009 ntnu.nocbm 1 LEARNING AND MEMORY .docxhenrymartin15260
 
nowHow to be Army StrongI was 18 years old when I saw my fa.docx
nowHow to be Army StrongI was 18 years old when I saw my fa.docxnowHow to be Army StrongI was 18 years old when I saw my fa.docx
nowHow to be Army StrongI was 18 years old when I saw my fa.docxhenrymartin15260
 
NR-351 Transitions in Professional NursingWebsite Evaluation T.docx
NR-351 Transitions in Professional NursingWebsite Evaluation T.docxNR-351 Transitions in Professional NursingWebsite Evaluation T.docx
NR-351 Transitions in Professional NursingWebsite Evaluation T.docxhenrymartin15260
 
Ntc 362 Week 2, Integrative Network Design Project , Part 1By Alucar.docx
Ntc 362 Week 2, Integrative Network Design Project , Part 1By Alucar.docxNtc 362 Week 2, Integrative Network Design Project , Part 1By Alucar.docx
Ntc 362 Week 2, Integrative Network Design Project , Part 1By Alucar.docxhenrymartin15260
 
NTHEMIND OF GREATCOMPANIESBy Scott BlanchardThe.docx
NTHEMIND OF GREATCOMPANIESBy Scott BlanchardThe.docxNTHEMIND OF GREATCOMPANIESBy Scott BlanchardThe.docx
NTHEMIND OF GREATCOMPANIESBy Scott BlanchardThe.docxhenrymartin15260
 
nR E E 693 5T o c o m p l e t e th i s e x a m y o u n.docx
nR E E 693 5T o c o m p l e t e th i s e x a m y o u n.docxnR E E 693 5T o c o m p l e t e th i s e x a m y o u n.docx
nR E E 693 5T o c o m p l e t e th i s e x a m y o u n.docxhenrymartin15260
 
NSG6001 Advanced Practice Nursing I Page 1 of 5 © 2007 S.docx
NSG6001 Advanced Practice Nursing I Page 1 of 5 © 2007 S.docxNSG6001 Advanced Practice Nursing I Page 1 of 5 © 2007 S.docx
NSG6001 Advanced Practice Nursing I Page 1 of 5 © 2007 S.docxhenrymartin15260
 
NR360 We Can But Dare We.docx Revised 5 ‐ 9 .docx
NR360   We   Can   But   Dare   We.docx   Revised   5 ‐ 9 .docxNR360   We   Can   But   Dare   We.docx   Revised   5 ‐ 9 .docx
NR360 We Can But Dare We.docx Revised 5 ‐ 9 .docxhenrymartin15260
 
ns;,eilrlt.lnterviewing is one HR function.docx
ns;,eilrlt.lnterviewing is one HR function.docxns;,eilrlt.lnterviewing is one HR function.docx
ns;,eilrlt.lnterviewing is one HR function.docxhenrymartin15260
 
NR443 Guidelines for Caring for PopulationsMilestone 2 As.docx
NR443 Guidelines for Caring for PopulationsMilestone 2 As.docxNR443 Guidelines for Caring for PopulationsMilestone 2 As.docx
NR443 Guidelines for Caring for PopulationsMilestone 2 As.docxhenrymartin15260
 
NRB Dec’99 1WHITHER THE EMERGENCY MANAGER 1Neil R Bri.docx
NRB Dec’99 1WHITHER THE EMERGENCY MANAGER 1Neil R Bri.docxNRB Dec’99 1WHITHER THE EMERGENCY MANAGER 1Neil R Bri.docx
NRB Dec’99 1WHITHER THE EMERGENCY MANAGER 1Neil R Bri.docxhenrymartin15260
 
Now, its time to create that treasure map to hide the treasur.docx
Now, its time to create that treasure map to hide the treasur.docxNow, its time to create that treasure map to hide the treasur.docx
Now, its time to create that treasure map to hide the treasur.docxhenrymartin15260
 
NR361 Information Systems in HealthcareInterview with a Nursing.docx
NR361 Information Systems in HealthcareInterview with a Nursing.docxNR361 Information Systems in HealthcareInterview with a Nursing.docx
NR361 Information Systems in HealthcareInterview with a Nursing.docxhenrymartin15260
 
NR360 Information Systems in Healthcare Team Technology Pr.docx
NR360 Information Systems in Healthcare Team Technology Pr.docxNR360 Information Systems in Healthcare Team Technology Pr.docx
NR360 Information Systems in Healthcare Team Technology Pr.docxhenrymartin15260
 
NR443 Guidelines for Caring for PopulationsMilestone 2 Assess.docx
NR443 Guidelines for Caring for PopulationsMilestone 2 Assess.docxNR443 Guidelines for Caring for PopulationsMilestone 2 Assess.docx
NR443 Guidelines for Caring for PopulationsMilestone 2 Assess.docxhenrymartin15260
 
Nowak Aesthetics, was founded by Dr. Eugene Nowak in 1999, in Ch.docx
Nowak Aesthetics, was founded by Dr. Eugene Nowak in 1999, in Ch.docxNowak Aesthetics, was founded by Dr. Eugene Nowak in 1999, in Ch.docx
Nowak Aesthetics, was founded by Dr. Eugene Nowak in 1999, in Ch.docxhenrymartin15260
 
NR305 Health Assessment Course Project Milestone #2 Nursing Di.docx
NR305 Health Assessment Course Project Milestone #2 Nursing Di.docxNR305 Health Assessment Course Project Milestone #2 Nursing Di.docx
NR305 Health Assessment Course Project Milestone #2 Nursing Di.docxhenrymartin15260
 

More from henrymartin15260 (20)

NT2580 Week 1 Understanding IT Infrastructure Security An.docx
NT2580 Week 1 Understanding IT Infrastructure Security An.docxNT2580 Week 1 Understanding IT Infrastructure Security An.docx
NT2580 Week 1 Understanding IT Infrastructure Security An.docx
 
NTC362 Week 3OSI Model, Switching Systems, Network Channel Pr.docx
NTC362   Week 3OSI Model, Switching Systems, Network Channel Pr.docxNTC362   Week 3OSI Model, Switching Systems, Network Channel Pr.docx
NTC362 Week 3OSI Model, Switching Systems, Network Channel Pr.docx
 
NT2580 Week 4 Hardening a NetworkAnalysis 4.2Availability, In.docx
NT2580 Week 4 Hardening a NetworkAnalysis 4.2Availability, In.docxNT2580 Week 4 Hardening a NetworkAnalysis 4.2Availability, In.docx
NT2580 Week 4 Hardening a NetworkAnalysis 4.2Availability, In.docx
 
NTNU, May 2009 ntnu.nocbm 1 LEARNING AND MEMORY .docx
NTNU, May 2009 ntnu.nocbm 1 LEARNING AND MEMORY .docxNTNU, May 2009 ntnu.nocbm 1 LEARNING AND MEMORY .docx
NTNU, May 2009 ntnu.nocbm 1 LEARNING AND MEMORY .docx
 
nowHow to be Army StrongI was 18 years old when I saw my fa.docx
nowHow to be Army StrongI was 18 years old when I saw my fa.docxnowHow to be Army StrongI was 18 years old when I saw my fa.docx
nowHow to be Army StrongI was 18 years old when I saw my fa.docx
 
NR-351 Transitions in Professional NursingWebsite Evaluation T.docx
NR-351 Transitions in Professional NursingWebsite Evaluation T.docxNR-351 Transitions in Professional NursingWebsite Evaluation T.docx
NR-351 Transitions in Professional NursingWebsite Evaluation T.docx
 
Ntc 362 Week 2, Integrative Network Design Project , Part 1By Alucar.docx
Ntc 362 Week 2, Integrative Network Design Project , Part 1By Alucar.docxNtc 362 Week 2, Integrative Network Design Project , Part 1By Alucar.docx
Ntc 362 Week 2, Integrative Network Design Project , Part 1By Alucar.docx
 
NTHEMIND OF GREATCOMPANIESBy Scott BlanchardThe.docx
NTHEMIND OF GREATCOMPANIESBy Scott BlanchardThe.docxNTHEMIND OF GREATCOMPANIESBy Scott BlanchardThe.docx
NTHEMIND OF GREATCOMPANIESBy Scott BlanchardThe.docx
 
nR E E 693 5T o c o m p l e t e th i s e x a m y o u n.docx
nR E E 693 5T o c o m p l e t e th i s e x a m y o u n.docxnR E E 693 5T o c o m p l e t e th i s e x a m y o u n.docx
nR E E 693 5T o c o m p l e t e th i s e x a m y o u n.docx
 
NSG6001 Advanced Practice Nursing I Page 1 of 5 © 2007 S.docx
NSG6001 Advanced Practice Nursing I Page 1 of 5 © 2007 S.docxNSG6001 Advanced Practice Nursing I Page 1 of 5 © 2007 S.docx
NSG6001 Advanced Practice Nursing I Page 1 of 5 © 2007 S.docx
 
NR360 We Can But Dare We.docx Revised 5 ‐ 9 .docx
NR360   We   Can   But   Dare   We.docx   Revised   5 ‐ 9 .docxNR360   We   Can   But   Dare   We.docx   Revised   5 ‐ 9 .docx
NR360 We Can But Dare We.docx Revised 5 ‐ 9 .docx
 
ns;,eilrlt.lnterviewing is one HR function.docx
ns;,eilrlt.lnterviewing is one HR function.docxns;,eilrlt.lnterviewing is one HR function.docx
ns;,eilrlt.lnterviewing is one HR function.docx
 
NR443 Guidelines for Caring for PopulationsMilestone 2 As.docx
NR443 Guidelines for Caring for PopulationsMilestone 2 As.docxNR443 Guidelines for Caring for PopulationsMilestone 2 As.docx
NR443 Guidelines for Caring for PopulationsMilestone 2 As.docx
 
NRB Dec’99 1WHITHER THE EMERGENCY MANAGER 1Neil R Bri.docx
NRB Dec’99 1WHITHER THE EMERGENCY MANAGER 1Neil R Bri.docxNRB Dec’99 1WHITHER THE EMERGENCY MANAGER 1Neil R Bri.docx
NRB Dec’99 1WHITHER THE EMERGENCY MANAGER 1Neil R Bri.docx
 
Now, its time to create that treasure map to hide the treasur.docx
Now, its time to create that treasure map to hide the treasur.docxNow, its time to create that treasure map to hide the treasur.docx
Now, its time to create that treasure map to hide the treasur.docx
 
NR361 Information Systems in HealthcareInterview with a Nursing.docx
NR361 Information Systems in HealthcareInterview with a Nursing.docxNR361 Information Systems in HealthcareInterview with a Nursing.docx
NR361 Information Systems in HealthcareInterview with a Nursing.docx
 
NR360 Information Systems in Healthcare Team Technology Pr.docx
NR360 Information Systems in Healthcare Team Technology Pr.docxNR360 Information Systems in Healthcare Team Technology Pr.docx
NR360 Information Systems in Healthcare Team Technology Pr.docx
 
NR443 Guidelines for Caring for PopulationsMilestone 2 Assess.docx
NR443 Guidelines for Caring for PopulationsMilestone 2 Assess.docxNR443 Guidelines for Caring for PopulationsMilestone 2 Assess.docx
NR443 Guidelines for Caring for PopulationsMilestone 2 Assess.docx
 
Nowak Aesthetics, was founded by Dr. Eugene Nowak in 1999, in Ch.docx
Nowak Aesthetics, was founded by Dr. Eugene Nowak in 1999, in Ch.docxNowak Aesthetics, was founded by Dr. Eugene Nowak in 1999, in Ch.docx
Nowak Aesthetics, was founded by Dr. Eugene Nowak in 1999, in Ch.docx
 
NR305 Health Assessment Course Project Milestone #2 Nursing Di.docx
NR305 Health Assessment Course Project Milestone #2 Nursing Di.docxNR305 Health Assessment Course Project Milestone #2 Nursing Di.docx
NR305 Health Assessment Course Project Milestone #2 Nursing Di.docx
 

Recently uploaded

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

New folderAssignment _Sem2_2013.docxITECH10005000 Programmin.docx

  • 1. New folder/Assignment _Sem2_2013.docx ITECH1000/5000 Programming 1 School of Science, Information Technology and Engineering Assignment 2Semester 2, 2013 Introduction This assignment requires you to work with some lists and to explore some common algorithms. You will be working with a list of bank records which contain details of individual bank customers and their accounts. You will be required to provide a hardcopy of a written report (a word document) with some of your answers. You will also be required to hand the whole assignment (both code and reports) in electronic form. Task A Download the files bank.txt and assignment2.py. The file bank.txt is the input file for the program. It consists of a number of lines of text, each with five fields. These fields are: · The customer’s first name · The customer’s last name · The customer’s account number · The account type (savings, credit or cheque) · The account balance Assignment2.py already has some functionality added – ignore that for the moment. For each of the following functions provide the expected inputs, outputs and pseudocode in your report (note: you will probably find the assignment easier if you do this BEFORE you do your coding)
  • 2. a) Write a new function (called readInputFileIntoList) which will read the file bank.txt and place individual customer records into a list (effectively a ‘list of lists’). The function should NOT take the bank list as a parameter. It should return the bank list via its return statement. You may not assume that you know how many records are in the input file – it must work for any number of lines. For each line in the input file you should create an individual list with five elements (listed above). Use the ‘split’ function to help you with this. Once you have created this list, add it to the bank list. The result of executing readInputFileInfoList should be a list of bank records – one for each line in the file. b) Write a function called ‘printIndividualRecord’. It should take a list (corresponding to a single bank record) as a parameter. If the record is Bruce Willis 123313 savings 405.00 the function should print out the details of the record in the following format Bruce Willis has a savings account with account no: 123313 There is $405.00 in this account. c) Write a function called ‘printAllRecords’, which calls printIndividualRecord for each record in the bank list. It should take the bank list as a parameter. Task B
  • 3. Examine the functions already authored in assignment2.py. · swap · maxListByItem In the code, write a high-level description of what each of these functions is intended to do as a comment above the function code. This description should be no longer than five lines. Marks will be awarded according to how well your response reflects your understanding. Task C Examine the function ‘sortListUsingSelectionSort’ that has been written in assignment2.py. This function is not complete. Use the functions from task B to complete the implementation of this function. Note – it should not be necessary to move (change the order of) or delete the code that is already there. When complete the function should have sorted the list in descending order (biggest item first). In the code (not the report) add a brief comment (1 or 2 lines maximum) to each line to explain how the line contributes to the implementation of the selection sort. Also add a comment above the function to describe to someone else who might want to use it at a later time. This comment should be no longer than 5 lines. Marks for the comments will be awarded according to how well they reflect your understanding of the code. Task D Write functions to perform the following tasks. Each function should be properly commented, use well-chosen identifier names and have appropriate parameters and any other good programming practices.
  • 4. 1) Write a function, called ‘sortAccountTypeLastName’ that sorts the list by the account type. If account types are the same, sort the list by last name. You can use either insertion sort or bubble sort for this function. The original list should be passed in as a parameter. This list should be copied into a second list which should be sorted and returned by the function. 2) Write a function, called ‘printListToFile’, that will write the details of a list to a file called ‘bank.out’. The format for the output file should be the same as the input file. In other words, it should be possible to use ‘bank.out’ as input to the program. 3) Write a function, called ‘addInterest’ that charges 10% interest to each account with a negative account balance. Other account balances should remain unchanged. 4) Write a function, called ‘binarySearch’, implements a binary search. This function should take three parameters. a. the target (the value that you are looking for) b. the field being searched(eg account type, account balance etc.). c. the list itself If the target is found, return the index value where it was found. Otherwise the function should return -1. 5) Write a function, called ‘sortAnyTwoFields’ which performs a similar task to ‘sortAccountTypeLastName’ but which is more general. This function should have three parameters a. field1 – the first field to be sorted on b. field2 – the field to be sorted on if the values of field1 are equal c. bList – the bank list
  • 5. The original list should be passed in as a parameter. This list should be copied into a second list which should be sorted and returned by the function. For example sortAnyTwoFields (CUSTOMER_LAST_NAME, CUSTOMER_ACCOUNT_BALANCE, bankList) will sort by the customer’s last name. If the last names are the same, then the list is sorted by account balance. Assignment 2 Mark Sheet - ITECH1000-5000 Student Name: ____________________ Id: _____________ Marker: _______ Task Comments Mark Max Section A 6 readInputFileIntoList 2 printIndividualRecord 1 printAllRecords 1
  • 6. documentation 2 Section B 2 documentation 2 Section C 3 2 for functionality, 1 for comments 3 Section D
  • 8. CRICOS Provider No. 00103D Page 6 of 6 New folder/assignment2.py import string CUSTOMER_FIRST_NAME = 0 CUSTOMER_LAST_NAME = 1 CUSTOMER_ACCOUNT_NO = 2 CUSTOMER_ACCOUNT_TYPE = 3 CUSTOMER_ACCOUNT_BALANCE = 4 def readInputFileIntoList (): print "readInputFileIntoList is yet to be implemented" def printIndividualRecord (record): print "printIndividualRecord yet to be implemented"
  • 9. def printAllRecords (bList): print "printAllRecords yet to be implemented" def swap (pos1, pos2, bList): temp = bList[pos1] bList[pos1] = bList[pos2] bList[pos2] = temp def maxListByItem (item, bList): if len(bList) == 0: print "no items in list" return 0 maximum = bList[0][item] count = 0 pos = 0
  • 10. for record in bList: if maximum < record[item]: maximum = record[item] pos = count count = count + 1 return pos def sortListUsingSelectionSort (item, bList): sortedList = list(bList) pos = 0 for index in range(len(sortedList)): #insert code here return sortedList def sortAccountTypeLastName (bList): print "sortAccountTypeLastName yet to be implemented"
  • 11. def printListToFile (bList): print "printListToFile yet to be implemented" def addTenPercent (bList): print "addTenPercent is yet to be implemented" def binarySearch (target, item, bList): print "binarySearch yet to be implemented" def sortAnyTwoFields (field1, field2, bList): print "sortAnyTwoFields yet to be implemented" def main ():
  • 12. bankList = readInputFileIntoList () printAllRecords (bankList) sortedList = sortListUsingSelectionSort (CUSTOMER_ACCOUNT_NO, bankList) printAllRecords (sortedList) pos = binarySearch ("Phili", CUSTOMER_FIRST_NAME, sortedList) if (pos == -1): print "Item not found" else: printIndividualRecord (sortedList[pos]) addTenPercent (bankList)
  • 13. sortedList = sortAccountTypeLastName (bankList) printAllRecords (sortedList) printListToFile (sortedList) main () New folder/bank.txt Phil Smith 321971 cheque 420.90 Eldar Hajilarov 567834 savings 670.25 Sasa Ivkovic 452312 credit 190.80 Charlynn Miller 823848 cheque 23.49 Adil Bagirov 723124 credit -873.56 Ewan Barker 812840 cheque -22.45 David Gao 452353 credit 512.90 Shannon Bell 123948 credit 2090.45 Phil Smith 542321 credit 657.89 Marcello Bertoli 672314 savings 234.76 Alex Kruger 812043 cheque -900.82
  • 14. Leo Brunelle 823843 savings 1293.87 Grant Meredith 380284 savings 438.00 Peter Vamplew 928483 cheque -658.80 Glenn Stevens 284934 credit 1892.00 Jason Giri 453920 cheque 298.00 Peter Martin 659330 savings 902.89 Kylie Turville 349583 credit 800.78 Chris Turville 568373 credit -900.00 Phil Smith 292871 savings 60.00 Daniel Morales 87383 cheque 288.00 Guillermo PinedaVillacencio 898989 cheque 567.44 Shamsheer Syed 837437 credit 452.33 Long Jia 283923 savings 190.00 David Stratton 342873 credit 890.00 Greg Simmons 382834 savings -899.00 Musa Mammadov 990990 credit -900.00 Elizabeth Matuschka 700638 savings 200.00 Kaye Lewis 891212 savings 344.00
  • 15. Frank Deluca 672314 credit 500.00 David Gao 568933 credit -400.00 Brian Firth 828392 savings -450.00 Evan Dekker 434023 cheque -900.00 Sally Firman 932983 cheque -730.00 Rosemary Torney 485374 savings 898.00 Marijke Groothuis 943823 credit 890.00 Assignment 3 instructions Objective of the assignment: The objective of this assignment is to allow you to demonstrate your knowledge of the steps required to recruit and staff for an important segment of the workplace and to demonstrate your strategic skills to the CEO. You will share some of the essential strategic and administrative steps for this important function of Human Resources and will include metrics for which to evaluate the recruitment and selection approach that will be implemented. The situation: Suppose that you are the new HR Director at HSS (the case study presented in our Course Resources under modules) and you have already made a presentation to the CEO and the Board of Directors on the need for HR planning and and enhanced strategic role that HR must play in the organization. After that presentation, and having read the research on managing human resources strategically that you have presented (assignment 2 literature review), the CEO confides that she has been thinking about how the senior staff in the organization are recruited and selected. As a result, she has asked you to propose
  • 16. new recruitment and selection methods for the senior level employees. Deliverable: The CEO's directive to you is to prepare a short (approximately five-page double spaced) proposal that includes at the least: 1. A cover memo to the CEO providing an overview of the task assigned and a summary of your proposal 2. A description of at least three recruitment approaches that could be considered 3. A description of at least three selection approaches that could be considered 4. A cost/benefit analysis and comparison of the approaches of both the recruitment and selection approached 5. Metrics the organization could use to evaluate the effectiveness of the on-going recruitment and selection of senior level employees. Propose at least three metrics for the evaluation (include the time frame for your evaluation period such as six months after entry into the position). 6. Your recommended approach and your arguments/justification to defend your choices. 7. A conclusion section that includes a summary of the approaches recommended, the benefits and any other aspects to the proposal you want to highlight. Notes: Use topic headings to organization your presentation, include in-text citations for statements of fact, and provide a reference page if in text citations are used in the proposal, use professional level language and writing.