Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

40230112005LMS #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions Answers/LMS/Admin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class Admin extends User{
File passAdminsFile = new File("passwordAdmin.txt");
public Admin (String userName , String userID , String phoneNumber){
super("AdminUserName", "AdminUserID", "AdminPhoneNumber");

try{
boolean isPass = passAdminsFile.createNewFile();

}catch(IOException e){
System.out.println("error 404!\npage not found!");
}
}

public void pass(String password){
try{
FileWriter writePass = new FileWriter("passwordAdmin.txt" , true);
writePass.append(password);
writePass.close();
}catch(IOException e){
System.out.println("error 404!\npage not found!");
}
}
}
22 changes: 22 additions & 0 deletions Answers/LMS/Book.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import java.io.File;
import java.io.IOException;

public class Book{
File bookIdFile = new File("bookId.txt");
File titleFile = new File("titleBook.txt");
File authorFile = new File("authorBook.txt");
File statusFile = new File("statusBook.txt");
File descriptionFile = new File("descriptionBook.txt");

public Book(){
try{
boolean isId = bookIdFile.createNewFile();
boolean isTitle = titleFile.createNewFile();
boolean isAuthor = authorFile.createNewFile();
boolean isStatus = statusFile.createNewFile();
boolean isDescription = descriptionFile.createNewFile();
}catch(IOException e){
System.out.println("error 404!\npage not found!");
}
}
}
Loading