首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代写program、代做MATLAB语言编程
项目预算:
开发周期:
发布时间:
要求地区:
Please read the project description very carefully:
For this project, you will be writing an account management system which will
manage a stock portfolio account and a bank account.
Please use an inheritance structure for the classes used in the program. Create an
abstract base class ‘Account’ that has two derived classes ‘StockAccount’ and
‘BankAccount’.
The ‘StockAccount’ and ‘BankAccount’ information should be connected to each
other through CASH BALANCE.
Stock portfolio account and Bank account will share a common initial balance of
10000$ available in your bank account. This balance keeps changing as the
transactions goes on.
Stock Portfolio Account
For the stock portfolio account portion, you will need to use stock information
stored in Results.txt files to create a portfolio managing system. (There are two
files of result.txt attached with the project description. This is to mimic the
changes in stock prices. The two files have same stock symbols with different
prices. Hence your program should randomly choose one stock value from one of
the two given files for all the transactions. That is, you need to choose a random
value from one of the two files whenever(!) you need to read a stock value,
including when you do sorting operation. Feel free to generate as many of your
own txt files or you may pull real time data from any financial websites.)
This portfolio system needs to store the account information in text files so that
when the program is closed the account information does not get lost. Each time the
program is run, it needs to read the current account information from the text files.
Whenever a transaction is made, please store the information in a text file (See
below for more details). Whenever the program exits, store the total portfolio value
and current cash balance along with the current date and time in a separate text file
to keep a record of the history of the portfolio values (to be used when graphing
the history of portfolio values). This file will be accessed by both ‘BankAccount’ and
‘StockAccount’ class. The common purpose of both the accounts is to access the
current cash balance information in this file. Whenever the program exits and starts
again, it shall use this updated balance and not the initial balance of $10000.
You must use a doubly linked list in the ‘StockAccount’ class to store the
portfolio stock information. Each node should contain the stock symbol and the
number of shares of that stock in the portfolio. Please implement the doubly
linked list yourself (don’t use STL). You can use your implementation from the
homework assignment. You can use whatever data structures (including STL
structures) you want for the other data used in the program, but please use
doubly linked lists for the portfolio stock information.
You must keep your stock portfolio in the doubly linked list sorted at all times in
the decreasing order of the total value of any particular stock (i.e. number of
shares * price per share). That is, after any update on your stock portfolio, you
need to check and maintain the doubly linked list so as to keep it sorted.
To implement the sorting, do not copy the values into a different data structure
and then sort it. The doubly linked list must be sorted in place, that is, by
changing the links of nodes in the list.
You are required to use at least two Design Patterns learned in class in your
program. You need to write clear comments in your program to highlight the use
of the design patterns, and explain them in your written project description. You
should be creative in using design patterns for your project – for example, you
can allow the user to choose/change to different sorting methods to keep your
linked list in order, and use a design pattern to implement this.
Your program should be able to perform the following:
1. Display the price of a stock – Display the price for a stock symbol based on
the information obtained randomly from one of the two Results.txt files. The user
would enter a stock symbol (that is contained in the Results.txt) and the program
will return a price per share. If the symbol is not found, return that the symbol
cannot be found.
Example:
Company-Symbol Price per share
GOOG $577.49
2. Display the current portfolio – The cash balance and information about the
stocks in the portfolio should be displayed in the order of the sorted list. For
each stock please display the symbol, the number of shares owned, the price per
share (based on the value from Results.txt), and the total value of that stock.
Please also display the total value of the portfolio.
Example:
Cash balance = $5000
CompanySymbol Number PricePerShare TotalValue
GOOG 10 $577.49 $5774.90
MSFT 100 $30.00 $3000.00
Total portfolio value: $13774.90
3. Buy shares – The user will send a request to buy shares of a stock. The user
should enter the ticker symbol of the stock he/she wants to buy, enter the amount
of shares he/she wants to buy and the maximum amount he/she is willing to pay
for each share of the stock (the limit). If the user has entered a stock purchase
amount that is more than his or her current cash balance in bank account, the
transaction should fail and the program should print out the reason.
Each time the user requests to buy shares, the stock pricing information from
Results.txt should be consulted (or you can just store the information into a data
structure upon the start of the program and use that data structure whenever you
need the information). If the stock ticker is not found in the text files, the program
should print that the stock is not available. If the cost per stock is higher than the
amount the user is willing to pay, the transaction should fail and the program
should print out the reason the transaction failed.
If the transaction goes through, the cost of the transaction should be deducted
from the bank cash balance and the stock that has been purchased should be
added to the portfolio. Make sure to use the price of the stock that is in the
Result.txt file when updating the portfolio. If the user already has that stock in his
or her portfolio, add the number of shares purchased to that entry instead of
creating a new entry (remember, you want to use a linked list to store the
information).
The program should display on the screen the information from the transaction
that has taken place. Please add this transaction to the
stock_transaction_history.txt file. You also need to add a withdrawal transaction
to your bank account transaction history for this buying operation.
4. Sell shares – The user will send a request to sell shares of a stock. The user
should enter the ticker symbol of the stock he/she wants to sell, the amount of
shares he/she wants to sell and the minimum amount he/she wants to sell each
share of the stock for. If the user has entered a stock that is not in the portfolio,
or if there are insufficient shares in the portfolio, the program should display this
and the transaction should fail.
Each time the user requests to sell shares (and the shares are available), the stock
pricing information from Results.txt should be used. If the price per stock is lower
than the amount the user is willing to sell for, the transaction should fail and the
program should print out the reason the transaction failed.
If the transaction goes through, the amount obtained from the “sell transaction “
should be added to the bank cash balance and the shares that have been sold
should be subtracted from the portfolio. If the number of shares of the stock is 0,
the stock should be removed from the portfolio. Make sure to use the price of the
stock that is in Results.txt when updating the portfolio. The program should display
the information from the transaction that has taken place. Please add this
transaction to the stock_transaction_history.txt file. You also need to add a
deposit transaction to your bank account transaction history for this selling
operation.
5. View a graph for the portfolio value – As mentioned earlier, when the
program exits, the total portfolio value should be stored in a text file along with
the date and time. The total portfolio value is the sum of your current cash
balance and money worth of the stocks you own. Make sure that you use both
the “Results.txt” files for buy/sell transactions, so that the total portfolio value
keeps changing and not always constant. Plot the variation in the value of the
portfolio over a period of time. Use MATLAB to plot the graph.
You can use any period of time and the only information you need to display is the
change in total value of the portfolio. The following code below shows two ways to
print out the time:
#include
time_t seconds;
seconds = time(NULL);
cout<<"The number of seconds since January 1, 1970 is:" <
tm * timeinfo;
timeinfo = localtime(&seconds);
cout<<"The current local time and date is:"<
Please look at this code to see how to obtain time information.
6. View transaction history – The buy and sell transaction should be saved in
stock_transaction_history.txt. If the user chooses this option, the transaction
history should be printed in order of transaction time.
Example:
Event CompSymbol Number PricePerShare TotalValue Time Buy GOOG 10 $577.49
$5774.90 09:40:07 Buy MSFT 100 $30.00 $3000.00 13:37:00 Sell MSFT 50 $20.00
$1000.00 14:39:21
Bank Account
The bank account portion is simpler than the stock portfolio part.
The bank account should initially have a balance of $10,000. The amount in the
bank account should be stored in a text file upon exit so that it can be retrieved
the next time the program starts. Save all transaction history in
bank_transaction_history.txt.
As indicated before, when you buy or sell stock shares, money will come out of or
go into your bank account. These activities should all be recorded in your bank
account transaction history (as withdrawal or deposit, respectively).
Please have the following options:
1. View account balance – Prints out the account balance.
2. Deposit Money – The user selects the amount of money to deposit. This
amount should be added to the balance.
3. Withdraw Money – The user selects the amount of money to withdraw. If the
balance of the account is not sufficient to withdraw the amount, please print out
an error.
4. Print out history - The program should print out the history of transactions on
the account in order of transaction time.
Example:
Event Amount Date Balance
Deposit $500.00 11/05/2009 $10,500
Withdrawal $1000.00 11/06/2009 $9,500
Deposit $1500.00 11/07/2009 $11,000
(Here we assume there is no stock transaction in this example; otherwise, stock
transactions should also be printed for the bank account.)
Extra credit
Create a graphical user interface (GUI) for the program. You can use whatever
C++ libraries (such as MFC, QT or fltk) you choose to do this. If you decide to do
this please create it in a separate project (in FinalProject_gui_yourname.zip) and
also submit the non-graphical version of the program. (up to 20 extra points)
Submission Guidelines
1. Give a brief description of your project, the functions you have implemented,
data structures used, text files used or created and for what purpose and any
other descriptions of your project. If you made any extra features for the program
please clearly state it. Include the description in a Word file.
2. For the submission, please submit the entire project folder in a zip/rar file,
FinalProject_yourname.zip. Make sure you comment your code. Your visual studio
project should be named FinalProject_yourname. Please make sure all the cpp
filenames have your name in it.
Sample Program Output
Welcome to the Account Management System.
Please select an account to access:
1. Stock Portfolio Account
2. Bank Account
3. Exit
Option: 1
Stock Portfolio Account
Please select an option:
1. Display the price for a stock symbol
2. Display the current portfolio
3. Buy shares
4. Sell shares
5. View a graph for the portfolio value
6. View transaction history
7. Return to previous menu
Option: 1
Please enter the stock symbol: GOOG Company Symbol Price per share
GOOG $577.49
Please select an option:
1. Display the price for a stock symbol
2. Display the current portfolio
3. Buy shares
4. Sell shares
5. View a graph for the portfolio value
6. View transaction history
7. Return to previous menu
Option: 3
Please enter the stock symbol you wish to purchase: GOOG Please enter the
number of shares: 10
Please enter the maximum amount you are willing to pay per share: 580
You have purchased 10 shares of GOOG at $577.49 each for a total of
$5774.90.
Please select an option:
1. Display the price for a stock symbol
2. Display the current portfolio
3. Buy shares
4. Sell shares
5. View a graph for the portfolio value
6. View transaction history
7. Return to previous menu
Option: 3
Please enter the stock symbol you wish to purchase: MSFT Please enter the
number of shares: 100
Please enter the maximum amount you are willing to pay per share: 30
You have purchased 100 shares of MSFT at $30 each for a total of
$3000.00
Please select an option:
1. Display the price for a stock symbol
2. Display the current portfolio
3. Buy shares
4. Sell shares
5. View a graph for the portfolio value
6. View transaction history
7. Return to previous menu
Option: 2
Cash balance = $1225.10
Company-Symbol Number Price-per-share Total value GOOG 10
$577.49 $5774.90 MSFT 100 $30.00 $3000.00 Total portfolio
value: $10000.00
Please select an option:
1. Display the price for a stock symbol
2. Display the current portfolio
3. Buy shares
4. Sell shares
5. View a graph for the portfolio value
6. View transaction history
7. Return to previous menu
Option: 6
Event Company Symbol Number Price per share Total value Time Buy GOOG 10
$577.49 $5774.90 13:14:15 Buy MSFT 100 $30.00 $3000.00 13:37:42
Please select an option:
1. Display the price for a stock symbol
2. Display the current portfolio
3. Buy shares
4. Sell shares
5. View a graph for the portfolio value
6. View transaction history
7. Return to previous menu
Option: 7
Please select an account to access:
1. Stock Portfolio Account
2. Bank Account
3. Exit
Option: 2
Bank Account
Please select an option:
1. View account balance
2. Deposit money
3. Withdraw money
4. Print out history
5. Return to previous menu
Option: 2
Please select the amount you wish to deposit: $1000
Please select an option:
1. View account balance
2. Deposit money
3. Withdraw money
4. Print out history
5. Return to previous menu
Option: 1
1. You have $2225.10 in your bank account.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
代做ece5550: applied kalman ...
2024-12-24
代做cp1402 assignment - netw...
2024-12-24
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!