Dear all, I have problem designing my program to make it Object-oriented.Hope u guys can help me
I am doing a simple bank program. The program has 100 Customer Records. It can 1) Retrive data from a text file 2) Search & Display the Customer Record according to the id 3) Write data back to text file 4) The program also need to compute the interest of each record.
My initial design is like this... I have class Customer which contains the id,name etc then i have Bank class with a main method and static methods performing the 4 operations i mentioned above
for no 1) public static void readFile() etc
instead of using static method, how can i make my program to be OOP. thanks a lot
A couple of questions to help you (and us) understand what you are trying to do:
1. What data are you reading from the file? Does this file represent your "data store"?
2. When you say you need to compute the interest - is this interest rate specific to the Bank or can each customer account have a different interest rate / algorithm to compute the interest?
Joined: May 25, 2005
thank u Francis Shillitoe for ur reply
hi Timmy Marks, my data is like this, saved in *.txt file
Account Id = 65 Name = Salma Hayek Address = 45 Mexican Boulevard, Hotel California, Singapore 467822 DOB = 06-04-73 Phone Number = 790-0000 Account Balance = 2345.00
Account Id = 78 Name = Phua Chu Kang Address = 50 PCK Avenue, Singapore 639798 DOB = 11-08-64 Phone Number = 345-6780 Account Balance = 0.00
As for the interest, it's as follows
Write a method miniDeposit that reads in the daily interest rate from keyboard and then outputs the necessary minimum deposit to produce 1 cent interest-profit from the deposit. Note that any interest-profit less than 1 cent will not be credit to your account by the bank. The method should also list the accounts that get no interest.
Frankly speaking, I have no idea what the above paragraph is about.
It looks like you didn't read our naming policy on your way in. It requires that you use a full, real (sounding) first and last name for your display name. Joke names and "handles" aren't acceptable here. You can change your display name here. Thanks!
hi guys, I need to expand this class to include more functions. I have 3 accounts. Account1, Account2 and Account 3 which 3 are requrired to be extends frm CustomerRecord. these 3 Accounts contains only 1 member variable which is the double interestin each class. I need to provide an update() method which make use of polymorhphism to update the interests in the 3 Account classes. How should I approach tt? My CustomerRecord can only have 100 objects.
Since I will declare Account1, Account2 ,Account 3 separately, how do I know tt my CustomerREcords wun reach more than 100? I need to keep track number of Account1,2,3 individually and sum them together?