-
Notifications
You must be signed in to change notification settings - Fork 0
/
TradingMenu.java
31 lines (29 loc) · 989 Bytes
/
TradingMenu.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
/**
* TradingMenu Class - implementing funcionality of trading class
*
* @author Nirmit Agrawal, [email protected]
* @version 1.3
* @since 10-17-2022
*/
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
public class TradingMenu {
public void addTrading(String username, String input)
{
String content ="\n"+username+":"+input;
String path = "C:\\Users\\DELL\\Desktop\\Nirmit\\ASU\\SER 515\\Assignments\\Design Pattern - Individual\\UserProduct.txt";
try {
Files.write(Paths.get(Paths.get(path).toUri()), content.getBytes(), StandardOpenOption.APPEND);
} catch (IOException e) {
throw new RuntimeException(e);
}
System.out.println("Trading has been added");
viewTrading(username);
}
public void viewTrading(String username)
{
System.out.println("viewTrading");
}
}