Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Driver Program Filename is based on your last-name, first-initial, and _P2 For example MuhammadJ_P2.java And the BankAccount Class file is save as BankAccountFILI.java ##

1. Driver Program Filename is based on your last-name, first-initial, and _P2 For example MuhammadJ_P2.java And the BankAccount Class file is save as BankAccountFILI.java ## at the beginning of both files -- put your name, student ID, location where this assignment has been completed, and a brief description about this file as a comment ## Zip both files together and name it LastnameFirst_P2.zip and submit on Blackboard The BankAccount class ~ BankAccount.java Based on UML class diagram 2. Attributes -- name, startBalance - appropriate access modifier and data types a. Scanner and DecimalFormat objects will need to be created . Note: ALL money amounts need to be printed correct, [Ex: $1,000,000.00] b. Create UML diagram 3. Constructor --(1) A constructor to initialize an objects attributes (2) No argument constructor 4. Accessor or getter methods calculateRate a. If the bank account balance is greater than or equal to $10,000.00, the calculateRate is 0.08 b. If the bank account balance is greater than or equal to $1,000.00, but less than $10,000.00 then the rate is 0.04 c. Otherwise, the rate is 0.02 5. Mutator or setter methods addInterest, deposit, withdraw a. addInterest calculate the interest amount (balance * rate). Show the user their balance BEFORE and AFTER the interest is added. Also, show the amount of interest that was added (see sample output). b. deposit add money to balance. Add interest if the new balance is greater than $1000.00 c. withdraw - subtract money from balance. d. Mutator methods to set name and startBalance 6. executeMenu will be the ONLY method that will be accessible by the driver (excluding extra credit). a. Display the bank menu options (see sample output) b. Prompt the user for their selection c. Create a switch statement that uses the users choice as the ordinal value; this value will be a char. Note: both upper and lowercase need to work i. Deposit Prompt the user for an amount. Deposit the money using the appropriate method. Print out the new balance ii. Withdraw Prompt the user for an amount. Withdraw the money using the appropriate method. Print out the new balance iii. Balance Print the users balance (see sample output) iv. Otherwise print an error message and exit the program, System.exit(0) The Driver Program ~ MuhammadJ_P2.java 7. Create a Driver class that should do the following tasks a. Create all necessary objects and variables with appropriate data types b. Read user name and initial amount of money they wish to deposit from the keyboard using BankAccount class: name, amount Prompt the user appropriately (see sample I/O). c. Create a BankAccount object, called account_XXX. Pass in appropriate variables i. Prompt the user that their account was created. ii. Access the BankAccount by calling executeMenu(). This should be called 7 TMES (see the sample output) d. Create an object for the No Argument Constructor i. Set the instance fields with the mutator methods in your class ii. Access the BankAccount by calling the executeMenu(). This should be called 4 times; with a deposit, withdrawal, balance 8. Comments should be put throughout the program to explain what is being done or computed; and programming style for readability. 9. Compile Errors 10. Delivery -- staple all document and turn-in by Monday October 20th a. Source code (.java files 2 files: Student.java and HackerH_P2.java) - submitted on Blackboard on due date by 11:59pm -- zip both files -- LastnameFirst_P2.zip b. Source code printout c. Output -- printout the result of your program Extra Credit: verifyUser() -- Verify that the correct user is trying to access the bank account. Ask the user for the account name and check to see if what they entered equals the name stored on the BankAccount object. If true, continue executing the program. If false, print invalid user message. + verifyUser (aName : String) : boolean

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 Publishing With Filemaker Pro On The Web

Authors: Maria Langer

1st Edition

0201696657, 978-0201696653

More Books

Students also viewed these Databases questions