Exact_Change_Random_Class
1| /*
2| NTC Java Programming 152-116
3| Instructor: John Heckendorf
4| Student: Jan Young & Keith Gallistel
5| Lab ID:
6| Project:pepsi.java
7| */
8|
9| import java.util.random;
10|
11| public class Exact_Change_Random_Class
12| {
13| final static long serialVersionUID = 5;
14|
15| public Take_Change_Event_Class(Control_Class oControl)
16| {
17|
18| }
19|
20| //This sets the Exact Change button randomly or if bank is less than $5.00
21| public boolean Rand_Exact(boolean bEC)
22| {
23| boolean bExact = false;
24| double dBank = 0;
25|
26| Random randomNumbers = new Random();
27|
28| int iNum = randomNumbers.nextInt(10);
29|
30| if(iNum > 5)
31| {
32| bExact = true;
33| }
34|
35| Money_Class oMoney = new Money_Class();
36| dBank = oMoney.Get_Bank();
37|
38| if(dBank < 5)
39| {
40| bExact = true;
41| }
42|
43| return bExact;
44| }
45|
46| }