Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Prof. Jiang ISM3230 HW4 Page 1 of1 Be sure to submit homework via Canvas, not email. Ask questions via email or Canvas inbox. Late assignments

image text in transcribed

Prof. Jiang ISM3230 HW4 Page 1 of1 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., HW4FirstNameLastName). There will be a penalty for not following this requirement. Homework 4 Objects and Classes (3 points) You are required to create two classes, a Transaction class modeled after a banking situation and the main class (containing the main method). Please closely follow the requirements below Requirements for the Transaction class: A private data field named as date (of Date data type), representing the date of the transaction A private data field named as type (of char data type), representing the type of the transaction, such as "W" for withdrawal and "D" for deposit A private data field named as amount (of double data type), representing the amount of the transaction A private data field named as balance (of double data type), representing the balance of the account after the transaction A private data field named as description (of String data type), representing the description of the transaction A constructor that creates an instance of the Transaction class with specified values of transaction type, amount, balance, and description, and date of the transaction. Note: 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) Define the corresponding accessor (get) methods to access a transaction's date, type, amount description, and the balance, i.e., you need to define 5 get methods. Define a toString() method which does not receive parameters but returns a String that summarizes the transaction details, including transaction type, amount, balance after transaction, description of the transaction, and transaction date. You can organize and format the returned String in your own way, but you must include all of the required information. . . Note: the purpose of the Transaction class is to document a banking transaction, i.e., when a transaction happens, you can use the transaction parameters to create an instance of the Transaction class. Requirements for the main class To test the Transaction class, in the main method of your main class you need to do the following Create two instances of the Transaction class that represent the following transactions: transaction 1: type: deposit; amount: 50; balance: 1050; description: babysitting income transaction 2: type: withdraw; amount: 30; balance: 1020; description: tennis fee o o Call the toString method of the Transaction class to print out a summary of each transaction. . Check the rubric on Canvas. Save your work before closing the project (especially if you can't compile it). After you have closed the project from the project tab in NetBeans, zip the NetBeans project folder and submit the zipped folder through Canvas. Note: you will need this Transaction class for HW5

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

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

What are the stages of project management? Write it in items.

Answered: 1 week ago

Question

2. Write two or three of your greatest weaknesses.

Answered: 1 week ago