0

do you know how to solve this question?

Refer to the following situation, build a class diagram using inheritance concept. Then create a java program. This is the ATM machine it will service one customer at a time. A customer will be required to insert an ATM card andenter a personal identification number (PIN) - both of which will be sent to the bank for validation as part of each transaction. The customer will then be able to perform one or more transactions. The card will be retained in the machine until the customer indicates that he/she desires no further transactions, at which point it will be returned . The ATM must be able to provide the following services to the customer: 1. A customer must be able to log in to the ATM. 2. A customer must be able to make a cash withdrawal from any suitable account linked to the card. 3. A customer must be able to make a deposit to any account linked to the card. 4. A customer must be able to make a transfer of money between any two accounts linked to the card. 5. A customer must be able to make a balance inquiry of any account linked to the card. 6. A customer must be able to pay the bill. it is for my assignment purpose i hope you guys could help me.

17th Oct 2024, 2:06 PM
zoey030
zoey030 - avatar
7 odpowiedzi
+ 4
You should attempt to solve this, then share your code with specific questions about what trouble you are having. We will advise how to resolve issues, but we won't write your assignment for you.
17th Oct 2024, 5:03 PM
Jerry Hobby
Jerry Hobby - avatar
+ 3
I would take out a pen/pencil and paper. You have your 6 tasks, write them as headlines. What does each task need? Do those smaller tasks need something too? Write each need down until you can't think of any more. These should then be your steps to tick off when you start writing your pseudocode. While writing the pseudocode, you might think of more tasks or needs, write them under the heading and write the pseudocode for them when you get to it. When all your pseudocode looks complete, create some tests: no card?, no PIN?, incorrect PIN?, not enough money?, and so on. Does your pseudocode give the right output for these? If not, why not? (Update your tasks/needs and pseudocode - test again) Finally, code away!! Good luck and happy coding
17th Oct 2024, 6:30 PM
Ausgrindtube
Ausgrindtube - avatar
+ 2
Bob_Li The bank have a customer database, so all the customers should be logged in before they get access to the ATM.
19th Oct 2024, 8:30 AM
Jan
Jan - avatar
+ 1
I think you need some classes like.... Bank Class ATM Class Customer Class Database Class ...and a bunch of methods and properties in those Classes. A well designed relational database is also needed.
17th Oct 2024, 9:15 PM
Jan
Jan - avatar
+ 1
For any transaction to occur, the card must first be inserted and verified. Where should this happen?
19th Oct 2024, 2:48 AM
Bob_Li
Bob_Li - avatar
+ 1
Bob_Li It's only a simulation, and it should be quite easy to simulate that. You can have an input field with the card number that verifies the number with the luhn algorithm, and then an input field for the pin code that is stored in the database.
19th Oct 2024, 7:46 AM
Jan
Jan - avatar
+ 1
Jan True, but if we try to make a good simulation, maybe it's worth considering where the authentication happens. Do we put the authentication code in the Bank class or in the ATM class?
19th Oct 2024, 8:05 AM
Bob_Li
Bob_Li - avatar