Description: Description: Description: Description: Description: Description: Description: Description: Breaking News! Click here for details.

 CSC 131 - Introduction to Computer Science

Homework 9 – Due Wednesday, November 29, 11:59pm

Submitted on Blackboard (learn.uncw.edu)

Programs based on material from Chapter 10 (Object-Oriented Programming)

Program 1: Bank Account

 

         It will use a class, BankAccount, similar to one that you developed in lab.

The UML diagram corresponding to this class is:

•         Create another file, ProcessAccounts.

•         At the top put

from BankAccount import *

•         Now have your program open the file accounts.txt.  Here is a sample accounts.txt file: accounts.txt.

•         Each line of that file contains one account.

•         <FirstName> <LastName> <AccountBalance>

 

•         Read in all the bank accounts, creating a corresponding BankAccount object and putting it in a list.

1.      Have your program “ProcessAccounts”, find and print the average balance of all of the accounts.

2.      The account with the biggest balance.

3.      The account with the smallest balance.

4.      Update each account’s balance by adding the interest rate (1.5% to the account balance).   Print out the average of all the accounts after this update.