Detailed Description: At the start, your program should ask the user to provide the card number and pin code as input. After taking input from the user the program should fetch user data corresponding to the input values from the database and store in a class level global variable. Taking input from the user is shown in figure no 1.Problem Statement:You are required to develop a Java program named MyATM, which should simulate behavior of a typical ATM (Automated Teller Machine). In which a user, after entering card details, can deposit amount, withdraw cash and check current balance. The program should be based on a user friendly interface; need to use Java Swing based GUI components for this purpose. Further, all information must be saved in a backend database using MS Access.
Fig. 1: Taking input from User
If input values are correct (i.e. found a user against provided card number and pin code) then following ATM services should be displayed via GUI;
1. Deposit Amount
2. Withdraw Cash
3. Check Balance
However, in case if input values are not correct (i.e. found no user against provided card number and pin code) then appropriate message should be shown, like; "Invalid Card No or Wrong Pin Code".
1. Deposit Amount:
Each time, user selects this option, s/he will be prompted to enter money for deposit that must be in multiple of Rs. 500/- (hint is given below) and up to a maximum of Rs. 25000/- per transaction. If inputs are correct then the amount must be added in current balance and as well as in database. However, in case of wrong input, appropriate message should be displayed.
2. Withdraw Cash:
User can withdraw any cash but in multiple of Rs. 500/- (hint is given below) and up to a maximum of Rs. 25000/- per transaction by using this option. However, if balance is zero or withdraw amount is greater than the balance, then appropriate message should be displayed. Otherwise, amount must be deducted from current balance and as well as database should be maintained.
3. Check Balance:
The program should fascinate the user by displaying the current balance as well via GUI.
Note: At the end of each successful transaction, the user must be asked to proceed with another transaction or not; if yes then start from displaying ATM services again and if not then show developer information (i.e. Student Id and name) via GUI.
Required Stuff:
Java Classes:
DebitCard.java (id,username,cardno,pincode,balance)
DbHelper.java (should contain all database related code)
MainClass.java (should contain GUI code)
Database file:
Id
|
Username
|
Card No
|
Pin Code
|
Balance
|
1
|
Ahmad
|
20201001
|
1041
|
3000
|
2
|
Ali
|
20201002
|
1226
|
0
|
3
|
Sana
|
20201003
|
2592
|
7000
|
4
|
Amna
|
20201004
|
6372
|
12000
|
5
|
Umar
|
20201005
|
9241
|
25000
|
BSxxxxxxxx.accdb (must be same as your own VU student id)
Note: need to put a database file in assets folder in NetBeans project directory; as shown below;
Important Things to Implement:
• For GUI, relevant components (i.e. JFrame, JPanel, JButton, JTextArea, JTextField and JLable etc.) from AWT and Swing packages should be used.
• You will have to use UCanAccess driver to connect to MS Access database. In this case, you are suggested to view the video tutorial shared above.
• For storing/fetching data to/from database, you will need to use proper SQL queries.
• Data must be stored/fetched to/from database table in the form of Java class object/s.
• You can use same Java classes (DebitCard and DbHelper etc.) as provided in assignment # 1 and also can make changes as required.
• Java classes must have proper Data Members and Member Functions along with Constructors, Standard Setters and Getters etc.
• Need to make sure that exceptions are managed properly throughout the program; especially NullPointerException, NumberFormatException, ClassNotFoundException and SQLException etc.
Assignment 2 Solution CS506
CS506
Course | Tittle | Solution Download Status |
---|---|---|
CS506 | Web Design and Development | Download Now
Uploaded |
0 Comments