-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjHead.h
More file actions
100 lines (86 loc) · 5.21 KB
/
ProjHead.h
File metadata and controls
100 lines (86 loc) · 5.21 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*******************************************************************************
* Author : Jesus Lopez *
* Assignment : Project One Header *
* Date : 11/5/17 *
* Class : CSC 17-A *
******************************************************************************/
#ifndef PROJHEAD_H
#define PROJHEAD_H
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <ctime>
#include <string>
#include <stdio.h>
#include <fstream>
using namespace std;
//Structures
struct Stock{
string name; //Input - Stock name.
float value; //Input - Stock value.
float percent[4]; //Input - Percent the stock can increase per day.
int count = 0; //Input - Amount of stocks user holds.
};
struct Player{
string name; //Input - Player name.
float money = 1000; //Input - Player's money.
float assets = 0; //Input - Player's stock value.
float total; //Output - Player's final score.
};
/*******************************************************************************
* PrntIntro *
* Prints out introduction to the game. *
******************************************************************************/
void PrntIntro();
/*******************************************************************************
* MainMenu *
* Displays the main menu. *
******************************************************************************/
int MainMenu(Stock*, Player*, int);
/*******************************************************************************
* InitStck *
* Dynamically allocates an array of stocks and initializes the array. *
* *
* RETURNS: Pointer to dynamically allocated array. *
******************************************************************************/
Stock* InitStck();
/*******************************************************************************
* InitPlyr *
* Dynamically allocates a player structure and asks for player name. *
* *
* RETURNS: Pointer to Player structure. *
******************************************************************************/
Player* InitPlyr();
/*******************************************************************************
* UpStock *
* Updates values of stocks after first day. *
******************************************************************************/
void UpStock(Stock*);
/*******************************************************************************
* BuyStck *
* Function where stocks are purchased. *
******************************************************************************/
void BuyStck(Stock*, Player*, int);
/*******************************************************************************
* SellStck *
* Function where stocks are sold. *
******************************************************************************/
void SellStck(Stock*, Player*, int);
/*******************************************************************************
* StkAmnt *
* Function that checks whether the player has stocks to sell. *
* *
* RETURNS: Boolean value which determines whether player can sell stocks. *
******************************************************************************/
bool StkAmnt(Stock*, int);
/*******************************************************************************
* UpPlyr *
* Function that updates player's assets. *
******************************************************************************/
void UpPlyr(Stock*, Player*);
/*******************************************************************************
* Stats *
* Displays player's final stats. *
******************************************************************************/
void Stats(Stock*, Player*);
#endif /* PROJHEAD_H */