Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java Language. This is an intro class, so we haven't learned all that much, so if you could, try not to use too advanced

In Java Language. This is an intro class, so we haven't learned all that much, so if you could, try not to use too advanced formatting as we likely have not learned them. Please try and run all the examples in your program to make sure you get the outputs expected. Also, do what the requirements ask, if you know a shortcut, please don't do it as I likely don't know it. Thank you

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

CSE 110: Principles of Programming Languages Assignment 6 Overview In this assignment you will write a program that will model a bank with multiple patrons who each have multiple accounts. The user will be able to add and remove patrons, as well as have the individual patrons manage their account and money. This will involve interactions between multiple classes which you have defined. When working as a programmer, you are often not writing code from scratch, but are instead adding to an existing project using classes written by others. With this in mind, you will not only be defining two of your own classes, but will also be using a class which will be provided to you. The interaction between classes looks like this: AccountType BankPatron AccountType AccountType BankPatron BankAccount AccountType AccountType PatronList BankPatron Assignment6 AccountType BankPatron AccountType AccountType BankPatron BankAccount AccountType Yes, this looks quite large, but keep in mind what's going on here. Each BankAccount object will have one AccountType (a single variable). Each BankPatron will have two BankAccounts (two BankAccount variables). The PatronList class has five BankPatrons, and finally your main Assignment6 file will have one PatronList object. So, in order to check the type of an account on a patron from the main file, you will need to ask your PatronList for the given Patron, ask that Patron for one of their accounts, and then ask that BankAccount object what its AccountType is. Note: The requirements listed below are provided in a specific order. Due to the way methods depend on other methods and classes depend on other classes, the requirements are provided in a "bottom-up" approach so that everything is defined before you try and use it. You are welcome to tackle the steps in any order, but you may have issues due to not having methods defined that you need However, the downside of this approach is that your main method will be the last thing you write. Make sure you make use of your empty main method to test methods and classes you've written before moving too much further ahead. The worst mistake to make would be to write all of this out before trying to test it at all! in order to write other ones. This bottom up approach is often how code is written. Requirements Your program must do the following in order to receive full credit on this assignment . Download the AccountType enum java file, which is attached to the assignment on Blackboard. Add it to your project and ensure it compiles. Sometimes an IDE, namely Eclipse, will have issues using files you did not create. If you get several problems (or see a message asking you to "Select Ant build" when you go to run it) create your own file (with the same name!) and copy and paste the contents into it. a. 2. Download the BankAccount class and add it to your project as well 3. 4. a. You are not to make any sort of edits to either of these files! Create a new class called BankPatron. Give BankPatron the following private instance variables. a. First Name b. Last Name c. Salary d. Cash on Hand e. Two BankAccount variables 1. See Step 5.d.1 ii. I is up to you to determine the needed types for all of these . Look at how BankAccount handles its variables relating to money You should use the same type it does. Create a default constructor, and then a regular constructor which takes the following 5. a. First Name b. Last Name c. Salary d. Cash on Hand c. Get Paid d. Apply Interest to Accounts e. Make Deposit f. Make Withdraw g. Return to Main Menu 25. Create a third menu method that prompts the user for which account type they want. This will be used when adding new accounts to a patron. a. Checking b. Savings c. CD d. Money Market e. IRA 26. Write a void method that handles actions for the patron specific menu. This should take a patron object as a parameter and apply all actions to that patron. a. b. Call the method to print the patron specific menu and store the user input c. Create a loop that will run until the user chooses to return to the main menu i. As always don't forget to reprint the menu and take a new input at the bottom of the loop. The actions to take in the loop are described in the following steps. 27. If the user chose to add a new account, determine what account type the user wants, d. accept a double as the interest rate from the user and then use that information to add a new account to the patron. a. Print out a message depending on whether adding the account succeeded or failed. 28. If the user chose to remove an account, accept an int from the user representing which account to remove and remove that from the patron object. a. Again, print a success or failure message. the patron get a paycheck. interest for each of the Patron's accounts and add it to the balance of that account. 29. If the user chose to have the patron receive a paycheck, call the method you wrote to have 30. If the user chose to apply the interest rate to the accounts, then calculate the amount of For example, if the first account had $100 in it and had a 2% interest rate, it would have $102 in it afterwards. Note that the rates are different for the two accounts and each should only get its own rate amount added to it. As is probably obvious, the accounts must exist in order to have interest added to them b. c. c. Remove Patron d. Patron Specific Actions e. Quit Type the full name of the patron you want. Mohammed Albasha Mohammed Albasha left the bank. a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Patrons currently at the bank: None a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Thank you for coming. #3 Welcome to the CSE 110 Bank! a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit What is the first name of the new patron? Ghaith Their last name? Salman Their yearly salary? 30000 How much cash do they have on hand? 300 Welcome to the bank, Ghaith a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Patrons currently at the bank Ghaith Salman a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Type the full name of the patron you want. Ghaith Salman What do you want to do with Ghaith Salman a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu Which account type did you want? a. Checking b. Savings c. CD d. Money Market e. IRA Please input the interest rate Account successfully added What do you want to do with Ghaith Salman a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu Which account (1 or 2) did you want to make a deposit in? How much did you want to deposit? 400 Patron does not have enough cash on hand! What do you want to do with Ghaith Salman a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu Which account (1 or 2) did you want to make a deposit in? How much did you want to deposit? 50 Deposit made What do you want to do with Ghaith Salman a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g.Return to Main Menu a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Patrons currently at the bank: Ghaith Salman Checking 1001 Balance: 50.0 Interest Rate: 2.0 a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Thank you for coming. #4 Welcome to the CSE 110 Bank! a. List Patrons b. Add New Patron c. Remove Patrorn d. Patron Specific Actions e. Quit What is the first name of the new patron? Yiting Their last name? Yao Their yearly salary? 10000 How much cash do they have on hand? Welcome to the bank, Yiting a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit What is the first name of the new patron? Shokoufeh Their last name? Monjezi Their yearly salary? 25000 How much cash do they have on hand? 20 Welcome to the bank, Shokoufeh a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Type the full name of the patron you want. Yiting Yao What do you want to do with Yiting Yao a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f. Make a Withdraw g. Return to Main Menu Which account type did you want? a. Checking b. Savings c. CD d. Money Market e. IRA Please input the interest rate Account successfully added What do you want to do with Yiting Yao a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu Which account type did you want? a. Checking b. Savings c. CD d. Money Market e. IRA Please input the interest rate 15 Account successfully added! What do you want to do with Yiting Yao a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f. Make a Withdraw g. Return to Main Menu a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Type the full name of the patron you want Shokoufeh Monjezi What do you want to do with Shokoufeh Monjezi a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g.Return to Main Menu What do you want to do with Shokoufeh Monjezi a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu Which account type did you want? a. Checking b. Savings c. CD d. Money Market e. IRA Please input the interest rate. Account successfully added! What do you want to do with Shokoufeh Monjezi a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu Which account (1 or 2) did you want to make a deposit in? How much did you want to deposit? 20 Deposit made What do you want to do with Shokoufeh Monjezi a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu What do you want to do with Shokoufeh Monjezi a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f. Make a Withdraw g. Return to Main Menu a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Patrons currently at the bank Yiting Yao CD 1001 Balance: 0.0 Interest Rate: 7.0 IRA 1002 Balance: 0.0 Interest Rate: 15.0 Shokoufeh Monjezi MoneyMarket 1003 Balance: 20.6 Interest Rate: 3.0 a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Thank you for coming #5 Welcome to the CSE 110 Bank! a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit What is the first name of the new patron? Ahmed Their last name? Moussa Their yearly salary? 1231 How much cash do they have on hand? 3432 Welcome to the bank, Ahmed a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit What is the first name of the new patron? Fatemeh Their last name? Haghighi Their yearly salary? 1231 How much cash do they have on hand? 3432 Welcome to the bank, Fatemeh a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit What is the first name of the new patron? Ghaith Their last name? Salman Their yearly salary? 1231 How much cash do they have on hand? 3432 Welcome to the bank, Ghaith a. List Patrons b. Add New Patron c. Remove Patrorn d. Patron Specific Actions e. Quit What is the first name of the new patron? Amber Their last name? Bennett Their yearly salary? 60000 How much cash do they have on hand? Welcome to the bank, Amber a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit What is the first name of the new patron? Void Their last name? Noid Their yearly salary? How much cash do they have on hand? Welcome to the bank, Void a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit What is the first name of the new patron? Green Their last name? Cheese Their yearly salary? How much cash do they have on hand? The line at the bank is full already! a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Patrons currently at the bank Ahmed Moussa Fatemeh Haghighi Ghaith Salman Amber Bennett Void Noid a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Type the full name of the patron you want. Void Noid Void Noid left the bank a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit What is the first name of the new patron? Green Their last name? Cheese Their yearly salary? How much cash do they have on hand? Welcome to the bank, Green a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Patrons currently at the bank Ahmed Moussa Fatemeh Haghighi Ghaith Salman Amber Bennett Green Cheese a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Type the full name of the patron you want. Green Cheese What do you want to do with Green Cheese a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu a. Checking b. Savings c. CD d. Money Market e. IRA Invalid Input Please input the interest rate. 20 Account could not be added! What do you want to do with Green Cheese a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Patrons currently at the bank Ahmed Moussa Fatemeh Haghighi Ghaith Salman Amber Bennett Green Cheese Checking 1001 Balance: 0.0 Interest Rate: 3.0 CD 1002 Balance: 0.0 Interest Rate: 15.0 a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Thank you for coming. Submission Please submit your Assignment6.java, BankPatron.java, and PatronList.java files to the Assignment 6 link on Canvas under the Assignments tab. You may submit as many times as you want prior to the due date, in case you later find and fix an error, but only the last one is graded. // Do NOT edit this file! public enum AccountType (Checking, Savings, CD, MoneyMarket, IRA) You are not to edit this file. You should look through it, but the graders will be using an exact copy of this file and if you make changes it will stop your program rom working or even compiling) and cost you a lot of points. public class BankAccount private int accountNumber private double balance private double interestRate; private String holderFirstName; private String holderLastName; private Accountlype typei private 3tatic int nextAccountNun 1001; public BankAccount () accountNumber = getNextAccountNum() ; balance 0.0; interestRate0.0 holderFirstName""; holderLastName "" type AccountType.Checking; public BankAccount (String first, String last, double rate, AccountTvpe accountNumber = getNextAccountNum() ; balance 0.0; interestRaterate; holde-Firs-Name = fi-3-. holderLastNamelast; type = at ; private int getNextAccountNum ) return nextAccountNum++ public int getAccountNum ) return accountNumber; public double checkBalance ) return baance ; public void deposit (double amount) balanceamount; public boolean withdraw (double amount) boolean succes3 Crue: if E ((balance - amount)0.0) I/ Only able to withdraw if there is actually enough money balance - amount ; successfalse: return Buccess public double getRate ) return interestRate; public void setRate (double rate) interestRaterate; public void applyInterest balance += (balance * (int erestRate / 100)); public String getHolderFullName return holderFirstName"" holderlastName public AccountType getType ) return typei CSE 110: Principles of Programming Languages Assignment 6 Overview In this assignment you will write a program that will model a bank with multiple patrons who each have multiple accounts. The user will be able to add and remove patrons, as well as have the individual patrons manage their account and money. This will involve interactions between multiple classes which you have defined. When working as a programmer, you are often not writing code from scratch, but are instead adding to an existing project using classes written by others. With this in mind, you will not only be defining two of your own classes, but will also be using a class which will be provided to you. The interaction between classes looks like this: AccountType BankPatron AccountType AccountType BankPatron BankAccount AccountType AccountType PatronList BankPatron Assignment6 AccountType BankPatron AccountType AccountType BankPatron BankAccount AccountType Yes, this looks quite large, but keep in mind what's going on here. Each BankAccount object will have one AccountType (a single variable). Each BankPatron will have two BankAccounts (two BankAccount variables). The PatronList class has five BankPatrons, and finally your main Assignment6 file will have one PatronList object. So, in order to check the type of an account on a patron from the main file, you will need to ask your PatronList for the given Patron, ask that Patron for one of their accounts, and then ask that BankAccount object what its AccountType is. Note: The requirements listed below are provided in a specific order. Due to the way methods depend on other methods and classes depend on other classes, the requirements are provided in a "bottom-up" approach so that everything is defined before you try and use it. You are welcome to tackle the steps in any order, but you may have issues due to not having methods defined that you need However, the downside of this approach is that your main method will be the last thing you write. Make sure you make use of your empty main method to test methods and classes you've written before moving too much further ahead. The worst mistake to make would be to write all of this out before trying to test it at all! in order to write other ones. This bottom up approach is often how code is written. Requirements Your program must do the following in order to receive full credit on this assignment . Download the AccountType enum java file, which is attached to the assignment on Blackboard. Add it to your project and ensure it compiles. Sometimes an IDE, namely Eclipse, will have issues using files you did not create. If you get several problems (or see a message asking you to "Select Ant build" when you go to run it) create your own file (with the same name!) and copy and paste the contents into it. a. 2. Download the BankAccount class and add it to your project as well 3. 4. a. You are not to make any sort of edits to either of these files! Create a new class called BankPatron. Give BankPatron the following private instance variables. a. First Name b. Last Name c. Salary d. Cash on Hand e. Two BankAccount variables 1. See Step 5.d.1 ii. I is up to you to determine the needed types for all of these . Look at how BankAccount handles its variables relating to money You should use the same type it does. Create a default constructor, and then a regular constructor which takes the following 5. a. First Name b. Last Name c. Salary d. Cash on Hand c. Get Paid d. Apply Interest to Accounts e. Make Deposit f. Make Withdraw g. Return to Main Menu 25. Create a third menu method that prompts the user for which account type they want. This will be used when adding new accounts to a patron. a. Checking b. Savings c. CD d. Money Market e. IRA 26. Write a void method that handles actions for the patron specific menu. This should take a patron object as a parameter and apply all actions to that patron. a. b. Call the method to print the patron specific menu and store the user input c. Create a loop that will run until the user chooses to return to the main menu i. As always don't forget to reprint the menu and take a new input at the bottom of the loop. The actions to take in the loop are described in the following steps. 27. If the user chose to add a new account, determine what account type the user wants, d. accept a double as the interest rate from the user and then use that information to add a new account to the patron. a. Print out a message depending on whether adding the account succeeded or failed. 28. If the user chose to remove an account, accept an int from the user representing which account to remove and remove that from the patron object. a. Again, print a success or failure message. the patron get a paycheck. interest for each of the Patron's accounts and add it to the balance of that account. 29. If the user chose to have the patron receive a paycheck, call the method you wrote to have 30. If the user chose to apply the interest rate to the accounts, then calculate the amount of For example, if the first account had $100 in it and had a 2% interest rate, it would have $102 in it afterwards. Note that the rates are different for the two accounts and each should only get its own rate amount added to it. As is probably obvious, the accounts must exist in order to have interest added to them b. c. c. Remove Patron d. Patron Specific Actions e. Quit Type the full name of the patron you want. Mohammed Albasha Mohammed Albasha left the bank. a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Patrons currently at the bank: None a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Thank you for coming. #3 Welcome to the CSE 110 Bank! a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit What is the first name of the new patron? Ghaith Their last name? Salman Their yearly salary? 30000 How much cash do they have on hand? 300 Welcome to the bank, Ghaith a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Patrons currently at the bank Ghaith Salman a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Type the full name of the patron you want. Ghaith Salman What do you want to do with Ghaith Salman a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu Which account type did you want? a. Checking b. Savings c. CD d. Money Market e. IRA Please input the interest rate Account successfully added What do you want to do with Ghaith Salman a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu Which account (1 or 2) did you want to make a deposit in? How much did you want to deposit? 400 Patron does not have enough cash on hand! What do you want to do with Ghaith Salman a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu Which account (1 or 2) did you want to make a deposit in? How much did you want to deposit? 50 Deposit made What do you want to do with Ghaith Salman a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g.Return to Main Menu a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Patrons currently at the bank: Ghaith Salman Checking 1001 Balance: 50.0 Interest Rate: 2.0 a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Thank you for coming. #4 Welcome to the CSE 110 Bank! a. List Patrons b. Add New Patron c. Remove Patrorn d. Patron Specific Actions e. Quit What is the first name of the new patron? Yiting Their last name? Yao Their yearly salary? 10000 How much cash do they have on hand? Welcome to the bank, Yiting a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit What is the first name of the new patron? Shokoufeh Their last name? Monjezi Their yearly salary? 25000 How much cash do they have on hand? 20 Welcome to the bank, Shokoufeh a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Type the full name of the patron you want. Yiting Yao What do you want to do with Yiting Yao a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f. Make a Withdraw g. Return to Main Menu Which account type did you want? a. Checking b. Savings c. CD d. Money Market e. IRA Please input the interest rate Account successfully added What do you want to do with Yiting Yao a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu Which account type did you want? a. Checking b. Savings c. CD d. Money Market e. IRA Please input the interest rate 15 Account successfully added! What do you want to do with Yiting Yao a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f. Make a Withdraw g. Return to Main Menu a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Type the full name of the patron you want Shokoufeh Monjezi What do you want to do with Shokoufeh Monjezi a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g.Return to Main Menu What do you want to do with Shokoufeh Monjezi a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu Which account type did you want? a. Checking b. Savings c. CD d. Money Market e. IRA Please input the interest rate. Account successfully added! What do you want to do with Shokoufeh Monjezi a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu Which account (1 or 2) did you want to make a deposit in? How much did you want to deposit? 20 Deposit made What do you want to do with Shokoufeh Monjezi a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu What do you want to do with Shokoufeh Monjezi a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f. Make a Withdraw g. Return to Main Menu a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Patrons currently at the bank Yiting Yao CD 1001 Balance: 0.0 Interest Rate: 7.0 IRA 1002 Balance: 0.0 Interest Rate: 15.0 Shokoufeh Monjezi MoneyMarket 1003 Balance: 20.6 Interest Rate: 3.0 a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Thank you for coming #5 Welcome to the CSE 110 Bank! a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit What is the first name of the new patron? Ahmed Their last name? Moussa Their yearly salary? 1231 How much cash do they have on hand? 3432 Welcome to the bank, Ahmed a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit What is the first name of the new patron? Fatemeh Their last name? Haghighi Their yearly salary? 1231 How much cash do they have on hand? 3432 Welcome to the bank, Fatemeh a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit What is the first name of the new patron? Ghaith Their last name? Salman Their yearly salary? 1231 How much cash do they have on hand? 3432 Welcome to the bank, Ghaith a. List Patrons b. Add New Patron c. Remove Patrorn d. Patron Specific Actions e. Quit What is the first name of the new patron? Amber Their last name? Bennett Their yearly salary? 60000 How much cash do they have on hand? Welcome to the bank, Amber a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit What is the first name of the new patron? Void Their last name? Noid Their yearly salary? How much cash do they have on hand? Welcome to the bank, Void a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit What is the first name of the new patron? Green Their last name? Cheese Their yearly salary? How much cash do they have on hand? The line at the bank is full already! a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Patrons currently at the bank Ahmed Moussa Fatemeh Haghighi Ghaith Salman Amber Bennett Void Noid a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Type the full name of the patron you want. Void Noid Void Noid left the bank a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit What is the first name of the new patron? Green Their last name? Cheese Their yearly salary? How much cash do they have on hand? Welcome to the bank, Green a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Patrons currently at the bank Ahmed Moussa Fatemeh Haghighi Ghaith Salman Amber Bennett Green Cheese a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Type the full name of the patron you want. Green Cheese What do you want to do with Green Cheese a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu a. Checking b. Savings c. CD d. Money Market e. IRA Invalid Input Please input the interest rate. 20 Account could not be added! What do you want to do with Green Cheese a. Add New Account b. Close Account c. Get Paid d. Apply Interest to Accounts e. Make Deposit f Make a Withdraw g. Return to Main Menu a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Patrons currently at the bank Ahmed Moussa Fatemeh Haghighi Ghaith Salman Amber Bennett Green Cheese Checking 1001 Balance: 0.0 Interest Rate: 3.0 CD 1002 Balance: 0.0 Interest Rate: 15.0 a. List Patrons b. Add New Patron c. Remove Patron d. Patron Specific Actions e. Quit Thank you for coming. Submission Please submit your Assignment6.java, BankPatron.java, and PatronList.java files to the Assignment 6 link on Canvas under the Assignments tab. You may submit as many times as you want prior to the due date, in case you later find and fix an error, but only the last one is graded. // Do NOT edit this file! public enum AccountType (Checking, Savings, CD, MoneyMarket, IRA) You are not to edit this file. You should look through it, but the graders will be using an exact copy of this file and if you make changes it will stop your program rom working or even compiling) and cost you a lot of points. public class BankAccount private int accountNumber private double balance private double interestRate; private String holderFirstName; private String holderLastName; private Accountlype typei private 3tatic int nextAccountNun 1001; public BankAccount () accountNumber = getNextAccountNum() ; balance 0.0; interestRate0.0 holderFirstName""; holderLastName "" type AccountType.Checking; public BankAccount (String first, String last, double rate, AccountTvpe accountNumber = getNextAccountNum() ; balance 0.0; interestRaterate; holde-Firs-Name = fi-3-. holderLastNamelast; type = at ; private int getNextAccountNum ) return nextAccountNum++ public int getAccountNum ) return accountNumber; public double checkBalance ) return baance ; public void deposit (double amount) balanceamount; public boolean withdraw (double amount) boolean succes3 Crue: if E ((balance - amount)0.0) I/ Only able to withdraw if there is actually enough money balance - amount ; successfalse: return Buccess public double getRate ) return interestRate; public void setRate (double rate) interestRaterate; public void applyInterest balance += (balance * (int erestRate / 100)); public String getHolderFullName return holderFirstName"" holderlastName public AccountType getType ) return typei

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_2

Step: 3

blur-text-image_3

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

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions