-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOopProjectHalilKayra.java
More file actions
39 lines (23 loc) · 948 Bytes
/
OopProjectHalilKayra.java
File metadata and controls
39 lines (23 loc) · 948 Bytes
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
package oopprojecthalilkayra;
import java.awt.Point;
import java.util.ArrayList;
public class OopProjectHalilKayra {
public static User activeUser = null;
public static ArrayList<Product> marketplace = null;
public static void main(String[] args) {
Database db = new Database();
marketplace = db.getMarketplace();
CommandLineUi.start();
}
public static int getProductIndexinMarketplace(String productName, String productColor){
int productId =-1;
for(int i = 0; i < marketplace.size(); i++){
if(marketplace.get(i).getProductName().equals(productName) &&
marketplace.get(i).getProductColor().equals(productColor)){
productId = i;
} else{
}
}
return productId;
}
}