Copyright  © – Sudharsan Iyengar

 

CS – 250: Individual/Pair Programming Assignment: #2 A  Due Date: 10/22/2017

 

You will need to create classes

·         Asset (has name and current value, numberavailable)

·         Stock (inherits Asset, taxrate = 30%)

·         MutualFund (inherits Asset, taxrate = 20%)

·         Bond (inherits Asset, taxrate = 10%)

·         Portfolio (has current value)

·         Folios (has StockPortfolio, MFPortfolio, BondPortfolio)

·         StockPortfolio (inherits portfolio, has array of Stock, and numberheld – for each stock)

·         MFPortfolio (inherits Portfolio, has array of MutualFund and numberheld – for each mutual fund)

·         BondPortfolio (inherits Portfolio, has array of Bond, and number held for each bond)

·         Account (has account holder name, account id)

·         CustomerAccount (has customer name, customer id, cash in hand, Folios)

 

·         Broker – Creates and holds arrays of CustomerAccount, Stock, MutualFund, and Bond.

 

Starting data is read, by Broker to create the objects, from text files.

 

Stock                           STK.dat (name, current value, number available)

 

            4

            FAST              12.5     300

            MSFT              33.9     3232

            IBM                77.5     6566

            GOOG             4343    757

 

Mutual Fund               MF.dat (name, current value, number available)

           

            3

            FIDA              55.6     64665

            FIDB               65.1     7757

            TRPA              12.6     72772

 

Bond                           BD.dat (name, current value, number available)

 

            TR5Y              120      770

            TR10Y            250      84848

            MN5Y             100      1212

            WI10Y                        75        7577

 

CustomerAccount       CA.dat (name, id, cash in hand, followed by 3 lines for folios - # stocks held, # mutual funds held, # bonds held)

 

 

John Williams              545      4598.50          

10 10 0 0

0 0 5

20 100 0 100

Jack Rabbit                 553      650.0

0 0 0 200

20 200 0

0 0 0 50

 

Create a GUI, and Listener classes to do the following.

 

a)      To list all stocks, their value, and number available

b)      To list all mutual funds, their value, and number available

c)      To list all bonds, their value, and number available

d)      To list all customer names, their cash in hand, and their portfolio content.

 

Your program should hold create the program structure such that it uses inheritance when appropriate, toString operations in the classes, and GUI that enables user to do the above-mentioned operations.

 

You need to inform me if you will pair with a partner by email before end of 10/16/2017.

 

Export your project to your folder on storage before midnight at the end of due date.