You will be building aStock Portfolio Applicationthat allows you to do transactions like buying and selling stocks and ability to deposit and withdraw cash from your brokerage account.You will...










You will be building aStock Portfolio Applicationthat allows you to do transactions like buying and selling stocks and ability to deposit and withdraw cash from your brokerage account.




You will create aTransactionHistoryclass with the following attributes (25 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 BUY/SELL for stock, DEPOSIT/WITHDRAW for CASH







double qty







Quantity for the transaction







double costBasis







Cost Basis of stock. For CASH this will be 1.00











Create the







  • constructor – Default and Overloaded constructor



  • Getter and Setter methods for all the attributes.










You will create another class calledPortfolioManagerthat will have themain methodto 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















0 - Exit














1 - Deposit Cash














2 - Withdraw Cash














3 - Buy Stock














4 - Sell Stock














5 - Display Transaction History














6 - Display Portfolio














Enter option (0 to 6):


















Things to consider:











  1. Make sure to put header comments for each of the java file.



  2. Make sure that you get an error message when invalid input is entered from the menu.



  3. Four Transaction Type – BUY, SELL, DEPOSIT, WITHDRAW



  4. Make cost basis for CASH transaction as 1.00.



  5. The CASH transactions are automatically created while buying or selling stock.



  6. When CASH is withdrawn, qty is negative and when deposited qty is positive



  7. Make sure to check if you have enough CASH in the bank to purchase stock.



  8. Withdrawl amount cannot be more than the CASH available in the account (Give an error message).



  9. When buying or sell stocks, create two transactions, the stock is purchased or sold, and other transaction of CASH withdrawn or deposited in the account.
















Hint:











  1. UseArrayListto create Transaction History.



  2. Loop through the transaction historyArrayListto generate the Portfolio information
















TEST CASES












Thehighlightedinformation is entered through the menu.











  1. Buying 100 stock DFEN after an initial deposit of $10000 CASH is made in the account. The cost of each DFEN stock is $15






The Transaction History will display







Ashish GulatiBrokerage Account











===============================













Date Ticker Quantity Cost Basis Trans Type








==================================================================











7/1/2022 CASH 10000.0 $1.0 DEPOSIT














9/20/2022 DFEN 100.0 $15.0 BUY











9/20/2022 CASH -1500.0 $1.0 WITHDRAW





The Portfolio will display







Portfolio as of: 12/06/2022 15:38:16








====================================








Ticker Quantity








=================








CASH 8500.0








DFEN 100.0












  1. Buying and selling of stock DFEN after an initial deposit of $10000 CASH is made in the account. 100 stocks of DFEN are bought at $15 and laterALLthe stocks are sold at $19, making a gain of $400 so the CASH in the portfolio increased $10400.00






The Transaction History will display










Ashish Gulati Brokerage Account












===============================













Date Ticker Quantity Cost Basis Trans Type








==================================================================











7/1/2022 CASH 10000.0 $1.0 DEPOSIT














9/20/2022 DFEN 100.0 $15.0 BUY











9/20/2022 CASH -1500.0 $1.0 WITHDRAW











11/22/2022 DFEN 100.0 $19.0 SELL











11/22/2022 CASH 1900.0 $1.0 DEPOSIT





The Portfolio will display







Portfolio as of: 12/06/2022 15:38:16








====================================








Ticker Quantity








=================








CASH 10400.0
















  1. Buying and selling of stock DFEN after an initial deposit of $10000 CASH is made in the account. 100 stocks of DFEN are bought at $15 and later50stocks are sold at $19, making a gain of $200 so the CASH in the portfolio increased $10400.00. Then $2000 is withdrawn from the bank.










The Transaction History will display










Ashish Gulati Brokerage Account












===============================













Date Ticker Quantity Cost Basis Trans Type








==================================================================











7/1/2022 CASH 10000.0 $1.0 DEPOSIT














9/20/2022 DFEN 100.0 $15.0 BUY











9/20/2022 CASH -1500.0 $1.0 WITHDRAW











11/22/2022 DFEN 50.0 $19.0 SELL











11/22/2022 CASH 950.0 $1.0 DEPOSIT











11/23/2022 CASH -2000.0 $1.0 WITHDRAW












The Portfolio will display







Portfolio as of: 12/06/2022 15:38:16








====================================








Ticker Quantity








=================








CASH 7450.0








DFEN 50.0












Grading Criteria





CreatingTransactionHistoryclass(25 marks)





Creating Menu to accept valid inputs and creating different types of transactions(25 marks)





Display Transaction History and Portfolio Information(25 marks)





Meets all the coding and testing requirements(25 marks)












Submission





Please make sure to submit the below files inzip format.







  • Both the java files



  • Screen snapshot of your program running in Word document



  • Please check the due date.No extensionafter the due date.

























Rubric













Final Project Rubric




















































































































Final Project Rubric





CriteriaRatingsPts












This criterion is linked to a Learning Outcome





TransactionHistory Class


Creating TransactionHistory Class
Create private attributes
Creating Default and Overloaded constructors
Getter and Setter methods
toPrint Method



















































25pts



Full Marks



























0pts



No Marks



If TransactionHistory.java file is not submitted


















25pts


















This criterion is linked to a Learning Outcome





Menu and Transaction List


Creating Menu to accept valid inputs and creating different types of transactions in an ArrayList.



















































25pts



Full Marks



























0pts



No Marks



Menu is not created PortfolioManager.java file is not submitted


















25pts


















This criterion is linked to a Learning Outcome





Display Transaction History and Portfolio Information


Display Transaction History
Display Portfolio Information



















































25pts



Full Marks



























0pts



No Marks





















25pts


















This criterion is linked to a Learning Outcome





Meets all the coding and testing standards


Program compiles and runs successfully (no compile errors).
Make sure to put header comments for each of the java file.
Code can be read easily (Uses Beautifier)
Make sure that you get an error message when invalid input is entered from the menu.
Make sure to check if you have enough CASH in the bank to purchase stock.
Withdraw amount cannot be more than the CASH available in the account (Give an error message).



















































25pts



Full Marks



























0pts



No Marks



If program cannot compile.


















25pts









Total Points:100











Apr 02, 2023
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here