I finished the part one to this but am having a difficult time to make it work .

Any feedbacks from people who might have done it?


Please select from the menu below:
1. Create Personal Customer
2. Create Commercial Customer
3. Record Transaction
4. Make Withdrawal
5. Display Customer
6. Display Customer Summary
7. Display Grand Summary
8. Exit

1. Create Personal Customer
a. The constructor will take 1 String – the name of the Customer. The constructor should set the customer name and generate the Customer ID (long).
b. Write a get method for the customer Name (String).
c. Write get/set methods for address (String), home phone (String) and work phone (String).
d. Write a get method for the Customer ID(long) and Account
2. Create Commercial Customer
a. The constructor will take 1 String – the name of the Customer. The constructor should set the customer name and generate the Customer ID (long).
b. Write a get method for the customer Name (String).
c. Write get/set methods for address (String), contact person (String), and contact person phone (String).
d. Write a get method for the Customer ID (long) and Account
e. Commercial customers get 3% more for their transactions above the standard price
3. Accounts
a. Create an Account for each customer. An account will have an account number (long), balance (double), date opened (Calendar) using the current date/time and interest rate (double).
b. Accounts have a default balance of 0 (balances cannot be less then 0) and a rate of 3%
c. Get methods should be created for each attribute
d. Accounts have two methods: makeDeposit (returns void) and makeWithdrawal (returns actual amount withdrawn from the account)
e. Note the account should be created when the Customer is created.

4. Record Transaction
a. Ask for the customer ID
b. If the customer ID is not found, state the ID could not be found and restart the menu
c. The transaction constructor will take no parameters, but will generate a Transaction ID (long) and will set the date/time of the transaction (Calendar) using the current date/time
d. Write get/set methods for Weight of Gold (double), Weight of Silver (double)
e. Write a get method for total value of the transaction (double)
f. Part of the transaction recording should include making a deposit into the Customer’s account for the appropriate amount
g. The transaction should be added to the Customer

5. Make Withdrawal
a. Ask for the customer ID
b. If the customer ID is not found, state the ID could not be found and restart the menu
c. Ask for the amount to be withdrawn from the account.
d. Withdraw the money from the account – the amount to be withdrawn must be greater then 0

6. Display Customer
a. Display the customer’s name
b. Display the customer’s ID
c. Display the details of their account
d. Display the details of each transaction

7. Display Customer Summary
a. Display the total number of customers
b. Display the sum total value of all accounts

8. Display Grand Summary
a. Display information for all customers

Reference
Display Values
Note that different values must displayed in different ways. Here are some examples
Display Item Format Examples
Metal Weight Round to 2 decimals, one digit left of decimal 325.40
0.56
Dollar Amount Dollar sign, round to 2 decimals, one digit left of decimal $200.34
$45.50
$0.35
Metal Values
Gold $400.50/ounce
Silver $6.25/ounce
Implementation notes

Any tips can be helpful.

Edited 6 Years Ago by bzmommy: changes

The descriptions are very clear. Just create separate classes for each part. For the account part just create the Account class.

In the main call those constructors to create what is asked. You will need a menu for that.

If you must have One account per Customer then you may use a Hashtable where the key would be the CustomerID and the value the Account object of that customer.

From your thread we fail to understand what exactly is your question and where is your problem

Hey JavaAddict,

Can you detail more about how to use the hashtable? Or is there another way to make customers have one account but more transactions?
I created the 2 classes that inherit from Customer , but i don't know how to link the unique ID with the unique account.

Thanks for the help.

Hey JavaAddict,

Can you detail more about how to use the hashtable? Or is there another way to make customers have one account but more transactions?
I created the 2 classes that inherit from Customer , but i don't know how to link the unique ID with the unique account.

Thanks for the help.

That would depend entirely on the your specific requirements, that may be different than the ones of the OP.
Usually the transaction is linked with the account, so many transactions can happen to a single account. For that case you can have a Transaction class with one of its attributes to be the accountId or the Account class.

As for the customer part, you need to make a new thread, specifying your requirements and what you have done so far

The requirements are the same with the original post.

I already created the 3 customer classes.
I will start creating the Account and Transaction classes and post my results afterwords.

how to link the unique ID with the unique account.

Have the key be the ID and the value be the account.

Thanks for the help. I am working on the transaction and account classes right now.

Norm, i could not find the duplicate post you mentioned, so i posted here, being the same project with the initial posting.

You should start your own thread for your problem and not hijack an existing thread.
This thread is old.

Will do, it is exactly the same project, so i did not want to post the same thing again.

This article has been dead for over six months. Start a new discussion instead.