In java programming language Design a class named Account that contains: • A private double data field named annualInterestRate that stores the current interest rate. Assume all accounts have the same interest rate (i.e. static member data). • A private int data field named nextAccountNb that stores the next account number to be assigned (default 300). Assume all accounts use this data member to assign the account number while creating an account (i.e. static member data). • A private int data field named accounNb for the account. • A private String data field named f_name for first name. • A private String data field named l_name for last name. • A private double data field named balance for the account. • A private Date data field named dateCreated that stores the date when the account was created. (usejava.util.Dateclass) • A constructor that creates an account for a given first name, last name, and initial balance. It sets up a new account number, first name, last name, balance, date of account creation, and advances nextAccountNb value by 1. • Appropriate accessor and mutator methods for accountNb, f_name, l_name, balance, annualInterestRate, and dateCreated. • A method named getMonthlyInterestRate() that returns the monthly interest rate. • A method named withdraw that withdraws a specified amount from the account. • A method named deposit that deposits a specified amount to the account. You should include appropriate data validation checks, e.g. balance should not be negative, name can include spaces, etc. Implement the class. Write a test program named SwanaBank that performs the following: - Displays a welcome message “Welcome to SWANA Bank” - Sets up an interest rate of 4.5% and displays the interest rate as today’s interest rate. - Prompts the user for first name, last name. Create an account with an initial balance of $100. - Displays the account details including monthly interest on the current balance. Allows user to deposit and withdraw as many times as they want. - Finally, ends with a good bye message. Your test program should access (i.e. get or set method) the static field annualInterestRate before creating accounts, and via an account object. Please refer to the screen shot below for precise details. Here is a sample screen shot: Welcome to SWANA Bank Today's Interest Rate is = 4.5% Enter first name: Malleswara Rao Enter last name: Talla Your account details are: Name is: Malleswara Rao Talla Account Number is 300 Current balance is $100.0 Interest Rate is = 4.5% Monthly interest for this balance is $0.375 This account was created on Sun Oct 24 10:42:51 EDT 2010 Enter your choice (0: deposit, 1: withdraw, 2: quit): 0 Enter the amount in $300 Enter your choice (0: deposit, 1: withdraw, 2: quit): 0 Enter the amount in $100 Enter your choice (0: deposit, 1: withdraw, 2: quit): 1 Enter the amount in $50 Enter your choice (0: deposit, 1: withdraw, 2: quit): 1 Enter the amount in $25 Enter your choice (0: deposit, 1: withdraw, 2: quit): 2 New balance is $425.0 Good Bye!

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

In java programming language

Design a class named Account that contains:
• A private double data field named annualInterestRate that stores the current interest rate.
Assume all accounts have the same interest rate (i.e. static member data).
• A private int data field named nextAccountNb that stores the next account number to be
assigned (default 300). Assume all accounts use this data member to assign the account number while creating an account (i.e. static member data).
• A private int data field named accounNb for the account.
• A private String data field named f_name for first name.
• A private String data field named l_name for last name.
• A private double data field named balance for the account.
• A private Date data field named dateCreated that stores the date when the account was
created. (usejava.util.Dateclass)
• A constructor that creates an account for a given first name, last name, and initial balance. It sets up a new account number, first name, last name, balance, date of account creation, and advances nextAccountNb value by 1.
• Appropriate accessor and mutator methods for accountNb, f_name, l_name, balance, annualInterestRate, and dateCreated.
• A method named getMonthlyInterestRate() that returns the monthly interest rate.
• A method named withdraw that withdraws a specified amount from the account.
• A method named deposit that deposits a specified amount to the account.
You should include appropriate data validation checks, e.g. balance should not be negative, name can include spaces, etc.
Implement the class. Write a test program named SwanaBank that performs the following:
- Displays a welcome message “Welcome to SWANA Bank”
- Sets up an interest rate of 4.5% and displays the interest rate as today’s interest rate.
- Prompts the user for first name, last name. Create an account with an initial balance of
$100.
- Displays the account details including monthly interest on the current balance.
Allows user to deposit and withdraw as many times as they want.
- Finally, ends with a good bye message.
Your test program should access (i.e. get or set method) the static field annualInterestRate before creating accounts, and via an account object. Please refer to the screen shot below for precise details.

Here is a sample screen shot:
Welcome to SWANA Bank Today's Interest Rate is = 4.5%
Enter first name: Malleswara Rao Enter last name: Talla
Your account details are:
Name is: Malleswara Rao Talla
Account Number is 300
Current balance is $100.0
Interest Rate is = 4.5%
Monthly interest for this balance is $0.375
This account was created on Sun Oct 24 10:42:51 EDT 2010
Enter your choice (0: deposit, 1: withdraw, 2: quit): 0 Enter the amount in $300
Enter your choice (0: deposit, 1: withdraw, 2: quit): 0 Enter the amount in $100
Enter your choice (0: deposit, 1: withdraw, 2: quit): 1 Enter the amount in $50
Enter your choice (0: deposit, 1: withdraw, 2: quit): 1 Enter the amount in $25
Enter your choice (0: deposit, 1: withdraw, 2: quit): 2
New balance is $425.0 Good Bye!

 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education