Please answer 2-5 in python in a simplified style (if possible)
or with a few notes. I'm new to object orientated programming and
I just want to know I'm on the right track. Thank you!
201609 COMP155 AB2 Assignment 1 (18 Marks) Fall 2016 Overview You may complete this assignment in Python or Ruby or C++ or Java. Other languages upon request. (3) ) (2) 1. Check in your code at a private git repository under a private called "comp155AB 1 assignment1" making sure to commit code to the repository at least twice (more than a day apart) between now and when the assignment is due. When it is ready for marking, add a tag called 'release to the master branch of the repository. Give me access to the repository, 2. Create classes with some of the functionality of a bank account. A single account may have one or more joint owners, but one customer can be the owner of only one bank account (for now). Each of the following should be represented by a class that can have data and functions: • • Customer class • Account class 3. • Customer should have the following attributes: Account, Full Name, Work Phone, Home Phone, Cell Phone, Address Line 1, Address Line 2. City, Province, Postal Code. • Customer should always have a full name and also has a default empty string for all of the (4) string values. 4 (3) ( • Customer should have member functions to set/get all of the data members. • Add validation code to ensure the following: - It is optional for a customer to have an account - A customer must have a full name of at least I character in length - One of the phone numbers must be set (any one), and additional phone numbers are optional - Address Line 2 can be blank, but the other address lines can not be blank For each of the above items, write a human readable error message to standard error when validation prevents an action from succeeding. For setter functions, return true if the operation succeeded, and return false if the operation failed. • Account should have the following data members: Account Number, status (can only be one of open, closed, frozen), date opened, branch number, subaccounts • Account should have a constructor that sets reasonable defaults for all of the data mem- bers. • Account should have member functions to set/get all of the data members where it makes sense to set the value add inline comments explaining any decisions to omit get/set func- tions). In the case of subaccounts add member functions to add and/or remove one subac- count at a time. • Add validation code to ensure the following: - The constructor always requires an account number and a Customer - A newly created account is automatically an open account - An open account can be closed or frozen. A closed account can not be opened or frozen. A frozen account can return to open state and it also can be closed without returning to open state first. a , - Account balance can be both negative or positive, and must be stored as an integer representing a number of pennies (cents) rather than dollars. - Account deposits and withdrawals must be done using number of pennies (cents) rather than dollars. Deposits and withdrawals must be positive numbers. - Ensure that the balance can never fall outside of the range of a 32 bit signed integer, but permit as much of this range as possible, including negative values. For each of the above items, write a human readable error message to standard error when validation prevents an action from succeeding. For setter functions, return true if the operation succeeded, and return false if the operation failed. 5. Write a test suite for the above functionality. Use the test suite to verify that your classes are implemented correctly. Ensure that I have access to your git repostory. Please post the path of your git repository to the assignment drop box. (6)
Please answer 2-5 in python in a simplified style (if possible) or with a few notes. I'm new to object orientated progra
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am