CSc 110: Banking

This assignment should be written in the python programming language. You should only use python features that we have discussed up to this point. If you have questions about whether or not a particular feature can/should be used, ask the instructors! You may use any python version 3.0 or newer.

All of your programming should be well-formatted and easy for the graders to read and comprehend. Each program file should have a header comment at the top that has the following format:

#
# Author: Student Name
# Description:
#    A short description of what this program does!
# 

If any part of your scripts are particularly complex, you should put documentation comments above those lines of code.

Banking

In this assignment, you will write multiple functions in a single python file named banking.py. Each of the functions will compute operations that a bank might need/want to know. In this assignment, you are not implementing a complete bank-account management system. Instead, you are going to write individual functions, that complete very specific bank-related tasks.

You should call the functions to test that they are working correctly. However, when you submit banking.py, do not leave any calls to the functions in there. The contents of the file should be only the function definitions. No need for a main() function.

You must use loops (while or for) to implement each of these functions except for min_max_account. You should not use the sum(), min() or max() built-in python functions. You may use sort().

sum_of_all_accounts

Write a function named sum_of_all_accounts. This function will have one parameter, named whatever you like, which you can assume will be a list of integers representing bank account values in US dollars. This function will compute the sum of all of the accounts. The sum will be returned by the function.

min_max_account

Write a function named min_max_account. This function will take one parameter, named whatever you choose, which you can assume is a list of integers representing bank account values in US dollars. This function will determine the smallest (minimum) and largest (maximum) bank account. Once the two numbers are determined, it will print them both out like so:

The min bank account is: X
The max bank account is: Y

But, instead of just printing X and Y, print the actual numeric values of the accounts.

get_max_customer

Write a function named get_max_customer. This function will have two parameters:

For example, the first argument might be the list [1000, 1500, 1200, 3000] and the second argument could be: ['Jim', 'Alex', 'Jane', 'Anne']. This means that Jim has $1000 in his account, Alex has $1500 in his, Jane has $1200 in hers, and Anne has 3000 in hers.

This function will return the name of the bank customer with the highest valued account.

report_all_acct_info

Write a function named report_all_acct_info. This function will have two parameters (the same parameters as get_max_customer):

This function will print out a “report” to the python console with the name and corresponding account value for each account passed to the function.

For example, if the first parameter is [100, 200, 450] and the second is [ 'John', 'Bill', 'Samuel' ], then the function will print the following when called:

All accounts
  John's bank account has $100
  Bill's bank account has $200
  Samuel's bank account has $450

report_acct_info

Write a function named report_acct_info. This function will take three total parameters. The first two will be the same as the previous two problems. The third one will be a single integer named minimum. This function will print out a similar report to the last problem. However, it will only print out accounts that have a dollar amount greater than than the minimum integer.

For example, if the first parameter is [100, 700, 900, 200, 450], the second is ['Jane', 'Ally', 'Bill', 'Will', 'Samuel'], and the third is 400, then the function will print the following when called:

All accounts valued greater than 400
  Ally's bank account has $700
  Bill's bank account has $900
  Samuel's bank account has $450

Submission and grading

This problem is due on 7/7/2017 at 7:00pm.

You should submit a single python file named banking.py, with each of the functions in it. You should not include a main function, or calls to any of the functions. Submit these files to the associated D2L dropbox. Following these turn-in and naming instructions closely is very important, because our grading scripts will depend on some of the details. You may lose points if these instructions are not followed precisely!