Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Accountsinfo.txt UsernamePasswordAccountIDDateOfBirth ZubayerEyxk%U#V 10000001 12/12/2000 Pastor@#ZmO_3J 10000002 2/3/1989 Parson5QaAwqWD 10000003 2/3/1999 Cougar@z&19u@E 10000004 12/2/1978 balancesheet.txt UsernameAccountIDTotal Transactions Zubayer10000001 500.0deposit27/03/2020500.0 Pastor10000002 0.0deposit27/03/20200.0 Pastor10000002 450.0 deposit27/03/2020450.0 Pastor10000002

Accountsinfo.txt

UsernamePasswordAccountIDDateOfBirth

ZubayerEyxk%U#V 10000001 12/12/2000

Pastor@#ZmO_3J 10000002 2/3/1989

Parson5QaAwqWD 10000003 2/3/1999

Cougar@z&19u@E 10000004 12/2/1978

balancesheet.txt

UsernameAccountIDTotal Transactions

Zubayer10000001 500.0deposit27/03/2020500.0

Pastor10000002 0.0deposit27/03/20200.0

Pastor10000002 450.0 deposit27/03/2020450.0

Pastor10000002 250.0 withdraw27/03/2020200.0

Parson10000003 0.0deposit27/03/20200.0

Cougar10000004 540.0deposit27/03/2020540.0

Parson10000003 390.0 deposit27/03/2020390.0

Cougar10000004 340.0 withdraw27/03/2020200.0

image text in transcribedimage text in transcribedimage text in transcribed
1. Write the following class files (.java) to create a bank account, deposit NewAccount: This java file will be used to create a new account and and withdraw to an already existing bank account. In order to contains the following methods: generatePassword(), createAccount() Result of creating account without any deposit in the two text files is as open/create a new bank account a user will either provide {name, date and other overloaded/overridden methods/constructors. follows: of birth(dob)} or {name, dob, initial amount). Your program should check whether same person (check both name and dob) has already an account AccessAccount: Contains all the required methods to check the existence . . . accountInfo.txt or not. If an account already exist, the user will not be able to create of an account, deposit an amount to the account and withdraw an Username Password AccountID DateOfBirth Zubayer Eyxk&U#V 10000001 12/12/2000 another account. amount from the account. Pastor @#Zm0_33 10000002 2/3/1989 Parson 50aAwqWD 10000003 2/3/1999 Whenever an account is created the following information will be generated by your program: a bank account number of eight digits and a Account: This class will use the other classes and methods to either ... balanceSheet.txt password of eight characters randomly selected from the following list of create an account or deposit/withdraw operations. Username AccountID Total Transactions characters: Zubayer 10000001 500.0 deposit 27/03/2020 500.0 AccountDriver: This class (.java) has been provided here such that you Pastor 10000002 0.0 deposit 27/03/2020 0.0 String alphabets="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkimnopqrstuvwxyz123456789 can follow to create other classes and/or required methods to maintain Pastor 10000002 450.0 deposit 27/03/2020 450.0 Pastor 27/03/2020 200.0 0#_19%^&@"; and manage bank accounts. 10000002 250.0 withdraw Parson 10000003 0.0 deposit 27/03/2020 0.0 Account information (account id, name, dob, and password) will be Enter your choice: 2 stored in a file named accountinfo.txt and all the transactions (i.e., Enter name: deposit and withdraw amount of all the accounts in the bank) are stored Sample Run: Cougar Day: 12 Enter date of birth as day month year (e. g. 23 12 2001): in another file named balanceSheet.txt. Snapshots of these two files are shown below. Enter your choice (1-5): Month: 02 Year: 1978 1. Create new account without deposit Enter initial deposit amount: .. . accountinfo.txt 2. Create new account with deposit an amount 540 Username Password AccountID DateOfBirth Zubayer Eyxk U#V 10000001 12/12/2000 3. Deposit an amount to an existing account Pastor @#Zm0_35 10000002 2/3/1989 4. Withdraw an amount from an account Your password: @z&19u@E and Account ID: 10000004 5. Exit 27/03/2020 balanceSheet.txt The amount 540.0 has been deposited to the newly created account! ! Enter your choice: 1 Enter your choice (1-5): Username Zubayer AccountID Total Transactions Enter name: Pastor 10000001 500.0 deposit 27/03/2020 500.0 10006002 0.0 deposit 10800802 4 27/03/2020 0.0 27/03/2020 450. 0 Parson 1. Create new account without deposit Pastor Pastor 10000002 250.0 withdraw 27/03/2020 200.0 Enter date of birth as day month year (e. g. 23 12 2001) : 2. Create new account with deposit an amount Day: 02 3. Deposit an amount to an existing account Month: 03 4. Withdraw an amount from an account Year: 1999 5. Exit 27/03/2020 Your password: 5QaAwqWD and Account ID: 10000003 Enter your choice: The amount 0.0 has been deposited to the newly created account! ! Enter your choice (1-5): Result of creating account with an initial deposit amount in the two text files is as follows: 1. Create new account without deposit Your program must have the following class (.java) files: 2. Create new account with deposit an amount 3. Deposit an amount to an existing account 4. Withdraw an amount from an account 5. Exit Enter your choice:... accountInfo.txt .. . balanceSheet.txt - Username Password AccountID DateOfBirth m Enter your choice: 4 Enter name: Cougar Enter password: @z&19u@E Zubayer EyxkU#V 10000001 12/12/2000 Username AccountID Total Transactions Zubayer 10000001 500.0 deposit 27/03/2020 500.0 Enter amount you want to withdraw: 500 Pastor @#Zm0_35 10000002 2/3/1989 Pastor 27/03/2020 0.0 money less than zero Parson 10000002 0.0 deposit You cannot withdraw money more than you have in your account or you can not withdraw 5QaAwqWD 10000003 2/3/1999 Cougar @z&19u@E 10000004 12/2/1978 Pastor 10000002 450.0 deposit 27/03/2020 450.0 Enter your choice (1-5) : Pastor 10000002 250.0 withdraw 27/03/2020 200.0 1. Create new account without deposit balanceSheet.txt Parson 10000003 0.0 deposit 10000004 540.0 deposit 27/03/2020 0.0 2. Create new account with deposit an amount 27/03/2020 540.0 3. Deposit an amount to an existing account 4. Withdraw an amount from an account Username AccountID Total Transactions Cougar Parson 10000003 390.0 deposit 27/03/2020 390.0 5. Exit Zubayer 10000001 500.0 deposit 27/03/2020 500.0 Pastor 10000002 0.0 deposit 10000002 450.0 deposit 27/03/2020 0.0 Enter your choice: 4 Enter your choice: Pastor 27/03/2020 450.0 Enter name: Cougar Pastor 10000002 250.0 withdraw 27/03/2020 200.0 Enter password: @z&19u@E Enter your choice: 4 Parson 10000003 0.0 deposit 27/03/2020 0.0 Enter amount you want to withdraw: 200| Enter name: Cougar Cougar 10000004 540.0 deposit 27/03/2020 540.0 WITHDRAW Enter password: @z&19u@E Enter amount you want to withdraw: 500 27/03/2020 You cannot withdraw money more than you have in your account or you can not withdraw Enter your choice: 3 You have withdrawsn 200.0. Now you have 340.0 in your account money less than zero Enter your choice (1-5) : Enter name: Parson Enter your choice (1-5): Enter password: 5QaAwqWD 1. Create new account without deposit Enter amount to be deposited: 390 1. Create new account without deposit 2. Create new account with deposit an amount The amount 390.0 has been deposited to the account 10000003 2. Create new account with deposit an amount 3. Deposit an amount to an existing account 4. Withdraw an amount from an account Enter your choice (1-5) : 3. Deposit an amount to an existing account 5. Exit 4. Withdraw an amount from an account Enter your choice: 1. Create new account without deposit 5. Exit Enter your choice: 4 2. Create new account with deposit an amount Enter name: Cougar 3. Deposit an amount to an existing account Enter your choice: Enter password: @z&19u@E Enter amount you want to withdraw: -700 4. Withdraw an amount from an account You can not withdraw money more than you have in your account or you can not withdraw money less than zero 5. Exit No change in the accountInfo.txt file. However, following change happens in Enter your choice (1-5): Enter your choice: | the balanceSheet.txt: 1. Create new account without deposit . .. balanceSheet.txt 2. Create new account with deposit an amount 3. Deposit an amount to an existing account 5. Exit No change in the accountinfo.txt file for depositing an amount to an existing Username AccountID Total Transactions 4. Withdraw an amount from an account Zubayer 10000001 500.0 deposit 27/03/2020 500.0 Pastor 27/03/2020 0.0 Enter your choice: account: 10000002 0.0 deposit Pastor 10000002 450.0 deposit 27/03/2020 450.0 ... accountInfo.txt Pastor 10000002 250.0 withdraw 27/03/2020 200.0 Username Password AccountID DateOfBirth Parson 10000003 0.0 deposit 27/03/2020 0.0 Zubayer Eyxk U#V 10000001 12/12/2000 Cougar 10000004 540.0 deposit 27/03/2020 540.0 Pastor @#Zm0_3J 10000002 2/3/1989 Parson 10000003 390.0 deposit 27/03/2020 390.0 Parson 5QaAwqWD 10000003 2/3/1999 Cougar 10000004 340.0 withdraw 27/03/2020 200.0 Cougar @z&19u@E 10000004 12/2/1978 The change of balanceSheet.txt is as follows: Screens 6-8 of 11 114%import java.util.Scanner; System.out.printIn("Enter date of birth as day month year(e.g. 23 System.out.printIn("Invalid day"); 12 2001):"); checkinput=true; public class AccountDriver { System.out.print("Day: "); } public static void main(String args) { day = kb.nextInt(); if(month31) { String name, dob, pass; System.out.print("Month: "); System.out.printIn("Invalid Month"); int ch,day, month, year; month = kb.nextInt(); checkinput=true; double amount; System.out.print("Year: "); Scanner kb = new Scanner(System.in); year = kb.nextInt(); return checkinput; Account acct; }while(checkinput(day,month,year)); dob = (day+"/"+month+"/"+year); do System.out.printIn("Enter initial deposit amount: "); acct = null; amount = kb.nextDouble(); System.out.printIn("Enter your choice (1-5):"); acct = new Account(name, dob, amount); System.out.print("\ 1. Create new account without deposit"); break; System.out.print("\ 2. Create new account with deposit an amount"); case 3: System.out.print("Enter name: "); System.out.print("\ 3. Deposit an amount to an existing account"); name = kb.nextLine(); End of document System.out.print("\ 4. Withdraw an amount from an account"); System.out.print("Enter password: "); System.out.print("\ 5. Exit"); pass = kb.nextLine(); System.out.print("\\\ Enter your choice: "); System.out.print("Enter amount to be deposited: "); ch = kb.nextInt(); amount = kb.nextDouble(); kb.nextLine(); acct = new Account(name, pass,"deposit",amount); switch(ch) { break; case 1: System.out.printIn("Enter name: "); case 4: System.out.print("Enter name: "); name = kb.nextLine(); name = kb.nextLine(); do { System.out.print("Enter password: "); System.out.printIn("Enter date of birth as day month year(e.g. pass = kb.nextLine(); 23 12 2001):"); System.out.print("Enter amount you want to withdraw: "); System.out.print("Day: "); amount = kb.nextDouble(); day = kb.nextint(); acct = new Account(name,pass, "withdraw",amount); System.out.print("Month: "); break; month = kb.nextint(); case 5: System.out.printIn("Exit."); System.out.print("Year: "); year = kb.nextInt(); }while(ch!=5); }while(checkinput(day,month,year)); dob = (day+"/"+month+"/"+year); acct = new Account(name, dob); private static boolean checkinput(int day, int month, int year) { break; boolean checkinput; case 2: System.out.printIn("Enter name: "); name = kb.nextLine(); checkInput=false; do { if(day31) {

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions