-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpStock.cpp
More file actions
21 lines (18 loc) · 819 Bytes
/
UpStock.cpp
File metadata and controls
21 lines (18 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*******************************************************************************
* Author : Jesus Lopez *
* Assignment : Project One Update Stock Values *
* Date : 11/5/17 *
* Class : CSC 17-A *
******************************************************************************/
#include "ProjHead.h"
void UpStock(Stock *s)
{
int rngSus; //Input - Random number 0 - 3.
for(int i = 0; i < 9; i++)
{
//Assigns rngSus a Random Number
rngSus = rand() % 3 + 0;
//Updates Stock Values
s[i].value = s[i].value + (s[i].value * s[i].percent[rngSus]);
}
}