β C# Librarian project
BlazeBin - oiyoptiqpaml
A tool for sharing your source code with the world!
49 Replies
do you have a question?
maybe he just wanted to make us aware of his current task
Yes sir, sorry for taking too long to replay.
I'm trying to create a book have I done it will?

why nobody uses names for stuff π
is it so unnatural to use like
case ActionNewBook:
instead of case 3:
also what is libraryManager
is it a repository? because then it would be libraryRepositorybecause its a choice menu
but using enums can work i guess
would that be an explanation?
because no
is this another uni project?
it is an explanation
because it's probably from a numbered list of choices
eg "press 3 to add a book"
So can I get some tips on how to create the book?
yes, you've already done it...which of course makes your question a little weird. What else exactly are you looking for or what don't you understand from what you've already done?
Ok! You're right. But what confused the hell of me are those user inputs, as you can see I'm doing the same, why would I take new user inputs with the same purpose?

why would I take new user inputs with the same purpose?idk what you are referring to with this statement? what new inputs?
I mean here, why should I create books? I am already creating books up in the top.
uhh...what's the difference between register new book and add books?
you created 2 distinct menu options so you're the best person to answer if they are actually overlapping or not
From the looks of it https://discord.com/channels/143867839282020352/1107745979169505361/1107995746520797234 looks like a sub routine that could be implemented at https://discord.com/channels/143867839282020352/1107745979169505361/1107762338716717108 instead of the current code in there
Faraj#6089
Ok! You're right. But what confused the hell of me are those user inputs, as you can see I'm doing the same, why would I take new user inputs with the same purpose?
Quoted by
<@!566641652744323112> from #C# Librarian project (click here)

React with β to remove this embed.
Faraj#6089
I'm trying to create a book have I done it will?
Quoted by
<@!566641652744323112> from #C# Librarian project (click here)

React with β to remove this embed.
As the first looks more detailed than the second
Sorry guys, it has been a misunderstanding π€¦ that took days of my time to figure out where the issue is located. My previous assignment required me to create books by taking user inputs for the
title
& author
and the Type
supposed to be inherited/sub-classes which's I've done already. The second image is my second assignment where they required me to update the program from bookshelf to librarian. Here is where I got stuck and felt very confused. In the second assignment they mentioned in the third image that there should be a method called SkapaBΓΆker()
in Swedish which means CreateBooks()
and I did not realize that, I have already created these books with sub-classes, but I needed to define a method that creates these books.


I think the assignment requirements are not very accurate and clear. They have already mentioned that I needed to create books, why the hell is mentioned again create books where I wasted days just to figure out the dame creating books π€·π»ββοΈ they didn't need to mention to define CreateBooks() method where I have already done this dame thing π
Could you make it more clear?
using a constant to make the code clear doesn't affect that π
it looks like this can be made into a sub routine

that can replace this

Yes, in the first image I'm orienting to the sub-class and get the book type, while user inputs are useless, since they're using variables and adding them to a list is just pointless.
Now, I will need to figure out how to print out these books using the override ToString() method
Any hints?
what data type are they stored in?
You mean the book?
what is
libraryManager
im guessing a class?I have used var for the title & author and string for the book type
Object
can i see the code for
libraryManager
?
as i am assuming it is an instance of a classYes, it is instance of a class Librarian
can i see the code?
Of course my friend
Here we go https://paste.mod.gg/guwltzbmcerw/2
BlazeBin - guwltzbmcerw
A tool for sharing your source code with the world!
am i missing something?

there is no Librarian class here
Oh! Sorry.
Wrong code
Now, you should be able to review the whole project https://paste.mod.gg/ocyfhwvffsra/1
BlazeBin - ocyfhwvffsra
A tool for sharing your source code with the world!
and what does it output?
Well! When choosing 1 from the meny, I am able to take user inputs for title & author and then choosing the type of book from the meny.
But the issue currently, it doesn't display the book title & author and the type π€·π»ββοΈ
Look


The bug is located in the case 2
I mean here

I modified the code and it looks like this currently

are you not going to have to do book.ToString() in there?
You mean in the object?
In the requirements it's mentioned that we can Use the ToString method directly.
Well in the code you've shown you are never actually using this ToString method
Really! How come?
That's weird
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.