Create a bankacount program

Assignment Help JAVA Programming
Reference no: EM131595792

You shall define a Customer class. A customer has a first name, last name, and social security number. The social security number is a String variable and must comply with this format: xxx-xx-xxxx where 'x' is a digit between 0-9. If a customer is supplied an invalid ssn, a message must be printed that the SSN of the customer is invalid; however, it will create the bank account regardless.

You shall define a BankAccount class. A BankAccount has a customer, account number, and a balance. A bank account can be opened with any amount of initial deposit. For each bank account, a 10 digit random account number must be created. Bank account shall define the following methods: deposit, withdraw. applyInterest, and checkBalance.

Every time there is a deposit or withdrawal, the amount and current balance should be displayed. One cannot withdraw more than the funds available in the account.

You shall define two types of bank accounts: Checking Account and Saving Account. Each account accrues interest. A saving account accrues 5% fixed interest and a checking account accrues 2% for any amount in excess of $10000 (For example, if there is $11000 in the checking account, the interest is only applied to $1000).

You shall define the BankMain class that defines the main method. You can use the "main" method shown below to test your application. The expected output is also provided.

public class BankMain {
public static void main(String[] args) {
CheckingAccount acct1 = new CheckingAccount("Alin", "Parker", "123-45-6789", 1000.0f);

CheckingAccount acct2 = new CheckingAccount("Mary", "Jones", "987-65-4321", 500.0f);

SavingAccount acct3 = new SavingAccount("John", "Smith", "1233-45-6789", 200.0f);

acct1.deposit(22000.00f);
acct2.deposit(12000.00f);

acct1.withdraw(2000.00f);
acct2.withdraw(1000.00f);

acct1.applyInterest();
acct2.applyInterest();

acct1.checkBalance();
acct2.checkBalance();

acct1.withdraw(30000.00f);
}
}


=================== This is the expected output =======================
Successfully created account for Alin Parker Account Number 3364673506
Alin Parker, Balance $1000.0
Successfully created account for Mary Jones Account Number 6221275878
Mary Jones, Balance $500.0
Successfully created account for John Smith. Inavlid SSN!
Successfully created account for John Smith Account Number 7091028094
John Smith, Balance $200.0
Alin Parker deposited $22000.0. Current balance 23000.0
Mary Jones deposited $12000.0. Current balance 12500.0
Alin Parker withdrew $2000.0. Current balance 21000.0
Mary Jones withdrew $1000.0. Current balance 11500.0
Alin Parker, Balance $21220.0
Mary Jones, Balance $11530.0
Unable to withdraw 30000.0 for Alin Parker due to insufficient funds
Previous
Next

Reference no: EM131595792

Questions Cloud

Revisions to the preliminary report : Make recommended revisions to the preliminary report completed in Week 4, and prepare it for inclusion in the final (Key Assignment) report.
Create a unique 3d animated scene : In this project you will create a unique 3D animated scene composed of Three.js graphic components. The scene should include animation, lighting
Analyzes a product advertising campaign : Write paper (12-15 pgs) that analyzes a product's advertising campaign. The analysis of the product advertising campaign (the Key Assignment final paper).
Do either tesla or ford have profit sanctuaries : Do either Tesla or Ford have profit sanctuaries? If so, How are they being used?
Create a bankacount program : Create a bankacount program - Every time there is a deposit or withdrawal, the amount and current balance should be displayed.
What general field of knowledge does the study investigate : What general field of knowledge does this study investigate? Examples could include: Research on Teacher Effectiveness, Research on Self-Reflective Learning.
Product design and development : Which type of product development effort would be better suited to concurrent engineering-a radically new product involving cutting-edge
Understand the ethical and leadership complexities : For this assignment, present an ethical analysis of a chosen issue. Your analysis should demonstrate your ability to understand the ethical and leadership.
Percent markup over full cost : Suppose IPS uses markup pricing for Android01. Fixed costs are $4.5 million, and for a level of production of 300 units, the variable cost-per-unit is $48,000.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd