Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Stock Portfolio Application Assignment Requirements Please read through the entire project requirements and use case to understand the project requirement. You will be using the

Stock Portfolio Application

Assignment Requirements

Please read through the entire project requirements and use case to understand the project requirement.

You will be using the IDE installed in week1 to create this application. You will be applying some of the concepts you have learnt 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 (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 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

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:

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 1.00.

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.

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

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:

Use ArrayList to create Transaction History.

Loop through the transaction history ArrayList to generate the Portfolio information

TEST CASES

The highlighted information is entered through the menu.

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 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

The Portfolio will display

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

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

Ticker Quantity

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

CASH 8500.0

DFEN 100.0

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 later ALL the 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

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 later 50 stocks 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

PLEASE NOTE THE FOLLOWING;

Answer should include screen snapshot of the program running and the name in the code should be "Charles Amu"

CODE SHOULD BE IN JAVA PLEASE

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

Database Marketing The New Profit Frontier

Authors: Ed Burnett

1st Edition

0964535629, 978-0964535626

More Books

Students also viewed these Databases questions

Question

a. How will the leader be selected?

Answered: 1 week ago

Question

b. Will new members be welcomed?

Answered: 1 week ago