-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUser_Info.java
31 lines (27 loc) · 1.13 KB
/
User_Info.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
//Importing files
import java.io.FileWriter;
import java.io.IOException;
//Class User_Info
class User_Info extends Registration_Login {
// Variable Money
int money;
// Constructor to create file username.txt and to write initial values in it
User_Info(String name, String username, String password, String number, String transaction, String FilePath) {
super(name, username, password, number);
this.money = 0;
try {
FileWriter fwrite = new FileWriter(FilePath + this.getUsername() + ".txt", true);
fwrite.write(this.money + "\r\n" + this.getName() + "\r\n" + this.getUsername() + "\r\n"
+ this.getPassword() + "\r\n" + this.getNumber() + "\r\n" + transaction + "\r\n");
fwrite.close();
// System.out.println("Content is successfully wrote to the file.");
} catch (IOException e) {
System.out.println("Unexpected error occurred");
e.printStackTrace();
}
}
// Message that will be shown on successful registration
void message() {
System.out.println("USER GENERATED SUCCESFULLY !");
}
}