Question: You will be using the IDE installed in week 1 to create this application. You will be applying some of the concepts you have learned
You will be using the IDE installed in week to create this application. You will be applying some of the concepts you have learned during this course to build a real application. You must be able to do research to build this solution if required.
You will be building a Stock Portfolio Application that allows you to do transactions like buying and selling stocks and ability to deposit and withdraw cash from your brokerage account.
You will create a TransactionHistory class with the following attributes points:
Private field Purpose of this field
String ticker Will store ticker of the Stock or CASH
String transDate Date when the transaction occurred
String transType Type of transaction BUYSELL for stock, DEPOSITWITHDRAW for CASH
double qty Quantity for the transaction
double costBasis Cost Basis of stock. For CASH this will be
Create the
constructor Default and Overloaded constructor
Getter and Setter methods for all the attributes.
You will create another class called PortfolioManager that will have the main method to test the application. This will have the following attributes
Private field Purpose of this field
ArrayList portfolioList new ArrayList; ArrayList to store any number of TransactionHistory records
You will create a menu for user to enter different types of transactions such as
DEPOSIT Cash
WITHDRAW Cash
BUY Stock
SELL stock
Create a menu as shown below to do the different types of transactions and display Transaction History and Portfolio Information.
Brokerage Account
Exit
Deposit Cash
Withdraw Cash
Buy Stock
Sell Stock
Display Transaction History
Display Portfolio
Enter option to :
Things to consider:
Make sure to put header comments for each of the java file.
Make sure that you get an error message when invalid input is entered from the menu.
Four Transaction Type BUY, SELL, DEPOSIT, WITHDRAW
Make cost basis for CASH transaction as
Stock ticker should be capitalized automatically. In other words, if user enters dfen, it should save as DFEN.
The CASH transactions are automatically created while buying or selling stock.
When CASH is withdrawn, qty is negative and when deposited qty is positive
Make sure to check if you have enough CASH in the bank to purchase stock.
Withdrawal amount cannot be more than the CASH available in the account Give an error message
When buying or selling stocks, create two transactions, the stock is purchased or sold, and other transaction of CASH withdrawn or deposited in the account.
Hint:
Use ArrayList to create Transaction History.
Loop through the transaction history ArrayList to generate the Portfolio information
I
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
