-
Notifications
You must be signed in to change notification settings - Fork 0
/
Seller.java
66 lines (62 loc) · 1.31 KB
/
Seller.java
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
/**
* Seller Class to inherit person class
*
* @author Nirmit Agrawal, [email protected]
* @version 1.3
* @since 10-17-2022
*/
import java.util.Scanner;
public class Seller extends Person{
Seller()
{
}
Seller(ProductMenu pm)
{
super(pm);
}
public void showMenu() {
this.pm.showMenu();
}
public void showcart(String username)
{
this.pm.showcart(username);
}
public void addTrading(String username){
TradingMenu tm = new TradingMenu();
String input = this.pm.input(username);
tm.addTrading(username, input);
}
public void startOperation(String username, String Category)
{
Scanner sc = new Scanner(System.in);
do {
System.out.println("Please select one of the following actions");
System.out.println("1. Show Menu");
System.out.println("2. Show cart");
System.out.println("3. Add an item to sell");
System.out.println("Any other number to exit");
int ans = sc.nextInt();
switch (ans) {
case 1:
showMenu();
break;
case 2:
showcart(username);
break;
case 3:
addTrading(username);
break;
default:
System.out.println("Returning");
break;
}
if(ans>3 || ans<1)
break;
}while(true);
}
@Override
public ProductMenu createProductMenu()
{
return null;
}
}