Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Be sure to submit homework via Canvas, not email. Ask questions via email or Canvas inbox. Late assignments will not be accepted. Important: please zip

image text in transcribedimage text in transcribed

Be sure to submit homework via Canvas, not email. Ask questions via email or Canvas inbox. Late assignments will not be accepted. Important: please zip the complete NetBeans project file (not just the jar or .java file) before submitting to Canvas. If you just submit the jar or .java file, it will not be graded and if you later submit the NetBeans project it may be treated as a late submission. Please name the project after your name (e.g., HWSFirstNameLastName). There will be a penalty for not following this requirement. Homework 5 Objects and Classes (8 points) You are required to create a NetBeans project modeled after a banking situation. First, create the project named as HWSYourFirstNameLastName. Check to create the main class, which will create a package under Source Packages, named after your project name, and open the main class containing the main method. Next, copy and paste the Transaction class from your HW4 into this package using NetBeans' Refactor feature. If not using Refactor, just copy and paste the Transaction class into this package, then open the Transaction class and update its first line of code by changing the package name to its current package name. For this project, you are required to create two classes other than the Transaction class: an Account class (whereas an account may incur multiple transactions) and the main class (containing the main method). Please closely follow the requirements below Requirements for the Account class: You need to create the Account class as an independent file in the same package of your main class. Class data fields: A private data field of int data type, representing the id of the account. A private data field of String data type, representing the name of the customer A private data field of double data type, representing the balance of the account. A private data field of double data type, representing the annual interest rate. Key assumptions: (1) all accounts created following this class construct share the same interest rate. (2) While the annual interest rate is a percentage, e. g., 4.5%, but for simplicity users will just enter the double number as 4.5 (not 0.045). Therefore, you, the code developer, need to divide the annual interest rate by 100 whenever you use it in a calculation A private data field of Date data type, representing the account creating date A private data field of ArrayList data type, representing a list of transactions for the account. Each element of this ArrayList must be an instance of the Transaction class defined in HW4 (the Transaction class has been copied into the current package) Class constructors: A no-arg constructor that creates a default account with default variable values. Another constructor that creates an instance of the Account class with specified values for account id name, and initial balance. Note: for both constructors, instead of passing a Date object to the constructor, you should use the new operator inside the body of the constructor to pass a new Date instance to the date data field (as we did for the Account class in class)

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

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

Which non - function is recuired when a description is g ven

Answered: 1 week ago