Skip to content

Assignment 1#5

Open
prashant1shukla wants to merge 5 commits intomainfrom
Assignment-1
Open

Assignment 1#5
prashant1shukla wants to merge 5 commits intomainfrom
Assignment-1

Conversation

@prashant1shukla
Copy link
Owner

image

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is CopiesAvailable? This should be named as NumberOfCopiesAvailable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants