Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Adam Gerber
/
labJava
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
496eae85
authored
Nov 09, 2015
by
Adam Gerber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interfaces List<>
parent
a6c598f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
src/lec07/glab/vend/VendMachine.java
src/lec07/glab/vend/VendMachine.java
View file @
496eae85
...
@@ -2,6 +2,7 @@ package lec07.glab.vend;
...
@@ -2,6 +2,7 @@ package lec07.glab.vend;
import
java.text.DecimalFormat
;
import
java.text.DecimalFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.TreeMap
;
import
java.util.TreeMap
;
...
@@ -53,9 +54,9 @@ public class VendMachine {
...
@@ -53,9 +54,9 @@ public class VendMachine {
private
static
DecimalFormat
sDecimalFormat
=
new
DecimalFormat
(
"$0.00"
);
private
static
DecimalFormat
sDecimalFormat
=
new
DecimalFormat
(
"$0.00"
);
//hold the vending machine's bank
//hold the vending machine's bank
private
Array
List
<
Coin
>
mBanks
;
private
List
<
Coin
>
mBanks
;
//hold user's money until vending
//hold user's money until vending
private
Array
List
<
Coin
>
mPurchaseMoneys
;
private
List
<
Coin
>
mPurchaseMoneys
;
private
Map
<
String
,
Product
[]>
mapProducts
;
private
Map
<
String
,
Product
[]>
mapProducts
;
...
@@ -216,14 +217,14 @@ public class VendMachine {
...
@@ -216,14 +217,14 @@ public class VendMachine {
}
}
public
Array
List
<
Coin
>
returnCoins
(){
public
List
<
Coin
>
returnCoins
(){
Array
List
<
Coin
>
conTemps
=
mPurchaseMoneys
;
List
<
Coin
>
conTemps
=
mPurchaseMoneys
;
mPurchaseMoneys
=
new
ArrayList
<>();
mPurchaseMoneys
=
new
ArrayList
<>();
return
conTemps
;
return
conTemps
;
}
}
public
Array
List
<
Coin
>
cashOut
(){
public
List
<
Coin
>
cashOut
(){
Array
List
<
Coin
>
conTemp
=
mBanks
;
List
<
Coin
>
conTemp
=
mBanks
;
//reset the bank
//reset the bank
mBanks
=
new
ArrayList
<>();
mBanks
=
new
ArrayList
<>();
return
conTemp
;
return
conTemp
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment