26 Sep CIS331 – Ch. 9 and 10 Exercise: Class BankAccount You are going to code and use a simple little bank account Class called BankAccount. The idea here is that instance objects of thi
CIS331 – Ch. 9 and 10 Exercise: Class BankAccount You are going to code and use a simple little bank account Class called BankAccount. The idea here is that instance objects of this class will represent separate bank accounts for customers. Here are your details: Part 1: Build the Class Data Fields: int accountID, String accountOwner, double accountBalance: all public. Constructors and Member Methods: On these, I will leave it up to your group to discuss return types, access specifiers, and logic except where noted. Remember that constructors have the primary job of giving your instance object's data fields their starting values. BankAccount() BankAccount(String accountOwner, double accountBalance) A "setter" method for accountOwner A “getter" method each for accountBalance and account Owner makeTransaction(double amount) It will add the amount to the account Balance data field. The value of amount could be positive or negative. If the accountBalance data field becomes <=0.0 due to this transaction, print a message stating that the account is overdrawn. Part 2: Use the Class Create an instance object of your BankAccount class. Initialize it with whatever customer name and balance you want to use in the constructor invocation. Make 3-4 transactions of positive and negative amounts. Print out the status of the account like so: Example: Owner: Suzy, Balance: $3445.32 Part 3: Store Transaction History Enhance your BankAccount class so that you can store a history of transactions made on each account. Create a new class, called Transaction that will simply store an amount and a description of the transaction. Create only a full constructor for the class (no 0-arg constructor is needed) To your BankAccount class, add an array of Transaction objects. Give the array a size of 100 in your constructors. Add any additional data field(s) that are needed to help manage the array and where new Transactions will be stored. Each BankAccount will have its own Transaction array. • Modify the makeTransaction() method from earlier so it accepts both an amount and description. The method should now create a new Transaction object and store it in the BankAccount's array. Correct any errors in your Application that result from these changes.
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Wridemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.
