Open
Conversation
Owner
prashant1shukla
commented
May 13, 2024

sanchit203
reviewed
May 26, 2024
Comment on lines
+9
to
+38
| Student student = new Student("id-1", "Prashant Shukla", "st-1"); | ||
| Teacher teacher = new Teacher("id-2", "Piyush", "t-1", "Maths"); | ||
| Admin admin = new Admin("id-3", "Admin User", "admin-1", "Administrator"); | ||
|
|
||
| library.AddUser(student); | ||
| library.AddUser(teacher); | ||
| library.AddUser(admin); | ||
|
|
||
| Book book1 = new Book("b-1", "Intro C# ", "Author-1", 5); | ||
| Book book2 = new Book("b-2", "DSA Book", "Author-2", 10); | ||
| Book book3 = new Book("b-3", "DevOps Book", "Author-3", 3); | ||
|
|
||
| library.AddBook(book1); | ||
| library.AddBook(book2); | ||
| library.AddBook(book3); | ||
|
|
||
| // Issuing books | ||
| library.IssueBook(student, book1); | ||
| library.IssueBook(student, book2); | ||
| library.IssueBook(teacher, book3); | ||
|
|
||
| // Displaying issued books | ||
| library.DisplayUserBooks(student); | ||
| library.DisplayUserBooks(teacher); | ||
|
|
||
| // Displaying issuer's name | ||
| library.DisplayIssuerName(student); | ||
| library.DisplayIssuerName(teacher); | ||
|
|
||
| // Displaying issuee list for a book |
There was a problem hiding this comment.
all these should be under a separate function called InitializeStaticData
Comment on lines
+21
to
+36
| library.AddBook(book1); | ||
| library.AddBook(book2); | ||
| library.AddBook(book3); | ||
|
|
||
| // Issuing books | ||
| library.IssueBook(student, book1); | ||
| library.IssueBook(student, book2); | ||
| library.IssueBook(teacher, book3); | ||
|
|
||
| // Displaying issued books | ||
| library.DisplayUserBooks(student); | ||
| library.DisplayUserBooks(teacher); | ||
|
|
||
| // Displaying issuer's name | ||
| library.DisplayIssuerName(student); | ||
| library.DisplayIssuerName(teacher); |
There was a problem hiding this comment.
This is not a console application which takes UserInput about the action that needs to be done. You have just defined some hard coded actions. Instead you should have asked for the user input
| public string BookId { get; set; } | ||
| public string Title { get; set; } | ||
| public string Author { get; set; } | ||
| public int CopiesAvailable { get; set; } |
There was a problem hiding this comment.
What is CopiesAvailable? This should be named as NumberOfCopiesAvailable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.