-
Notifications
You must be signed in to change notification settings - Fork 0
/
StockAccount_Goyal.h
84 lines (65 loc) · 1.92 KB
/
StockAccount_Goyal.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Name: Shreyas Bhandare
// Final project: Bank and stock account program
// Date of Submission: 12-13-2015
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#pragma once
#include<iostream>
#include<fstream>
#include<string>
#include<time.h>
#include<sstream>
#include<utility>
#include<map>
#include "Account_Goyal.h"
#include "StockNode_Goyal.h"
using namespace std;
#ifndef STOCKACCOUNT_GOYAL_H
#define STOCKACCOUNT_GOYAL_H
class StockNode;
class StockAccount : public Account
{
private:
string stkSymbol;
int offset;
int size;
int randfile;
int ctr2;
double portfolioval, valArray2[100];
string timeArr[100];
int sharenos;
double maxamount, minamount;
ifstream myFile, balancefile, portfile, portvalfile;
string tempp;
int sharetempp;
map<string, double> result1, result2;
map<string, int> portfolio;
ifstream myfile, myfile2;
stringstream ss;
stringstream sj;
stringstream sk;
string line, line2, symb1, date1;
double price1;
ofstream writebalancefile, writebankhis, writetoport;
StockNode *prev = NULL;
StockNode *headptr;
StockNode *tailptr;
public:
StockAccount(); // constructor
~StockAccount(); // destructor
void dispStockPrice(); // display stock price
void dispPortfolio(); // display current portfolio
void buyShares(StockNode *); // buying shares
void sellShares(); // selling shares
void viewPortGraph(); // view portfolio value variation graph
virtual void printHis(); // overriding printHis function to print stock history
bool sortStockList(); // sorting stock list
void savePortfolio(); // saving portfolio
void retrievePortfolio(); // retrieve portfolio at the beginning
virtual double getcbal(); // get cash balance
virtual void setcbal(); // setting cash balance
void savePortfolioVal(); // save portfolio value and time.
void retrievePortVal(); // retrieve portfolio value.
};
#endif