❔ C# Librarian project

BlazeBin - oiyoptiqpaml
A tool for sharing your source code with the world!
49 Replies
Jimmacle
Jimmacleβ€’3y ago
do you have a question?
hyperator
hyperatorβ€’3y ago
maybe he just wanted to make us aware of his current task
The king of kings
The king of kingsOPβ€’3y ago
Yes sir, sorry for taking too long to replay.
The king of kings
The king of kingsOPβ€’3y ago
I'm trying to create a book have I done it will?
hyperator
hyperatorβ€’3y ago
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 libraryRepository
TheRanger
TheRangerβ€’3y ago
because its a choice menu but using enums can work i guess
hyperator
hyperatorβ€’3y ago
would that be an explanation? because no
Haze.
Haze.β€’3y ago
is this another uni project?
jcotton42
jcotton42β€’3y ago
it is an explanation because it's probably from a numbered list of choices eg "press 3 to add a book"
The king of kings
The king of kingsOPβ€’3y ago
So can I get some tips on how to create the book?
Anu6is
Anu6isβ€’3y ago
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?
The king of kings
The king of kingsOPβ€’3y ago
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?
Anu6is
Anu6isβ€’3y ago
why would I take new user inputs with the same purpose?
idk what you are referring to with this statement? what new inputs?
The king of kings
The king of kingsOPβ€’3y ago
I mean here, why should I create books? I am already creating books up in the top.
Anu6is
Anu6isβ€’3y ago
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
Haze.
Haze.β€’3y ago
MODiX
MODiXβ€’3y ago
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)
From Faraj#6089
React with ❌ to remove this embed.
MODiX
MODiXβ€’3y ago
Faraj#6089
I'm trying to create a book have I done it will?
Quoted by
<@!566641652744323112> from #C# Librarian project (click here)
From Faraj#6089
React with ❌ to remove this embed.
Haze.
Haze.β€’3y ago
As the first looks more detailed than the second
The king of kings
The king of kingsOPβ€’3y ago
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.
The king of kings
The king of kingsOPβ€’3y ago
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?
hyperator
hyperatorβ€’3y ago
using a constant to make the code clear doesn't affect that πŸ˜’
Haze.
Haze.β€’3y ago
it looks like this can be made into a sub routine
Haze.
Haze.β€’3y ago
that can replace this
The king of kings
The king of kingsOPβ€’3y ago
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?
Haze.
Haze.β€’3y ago
what data type are they stored in?
The king of kings
The king of kingsOPβ€’3y ago
You mean the book?
Haze.
Haze.β€’3y ago
what is libraryManager im guessing a class?
The king of kings
The king of kingsOPβ€’3y ago
I have used var for the title & author and string for the book type Object
Haze.
Haze.β€’3y ago
can i see the code for libraryManager? as i am assuming it is an instance of a class
The king of kings
The king of kingsOPβ€’3y ago
Yes, it is instance of a class Librarian
Haze.
Haze.β€’3y ago
can i see the code?
The king of kings
The king of kingsOPβ€’3y ago
Of course my friend
The king of kings
The king of kingsOPβ€’3y ago
BlazeBin - guwltzbmcerw
A tool for sharing your source code with the world!
Haze.
Haze.β€’3y ago
am i missing something?
Haze.
Haze.β€’3y ago
there is no Librarian class here
The king of kings
The king of kingsOPβ€’3y ago
Oh! Sorry. Wrong code
The king of kings
The king of kingsOPβ€’3y ago
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!
Haze.
Haze.β€’3y ago
and what does it output?
The king of kings
The king of kingsOPβ€’3y ago
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 king of kings
The king of kingsOPβ€’3y ago
The king of kings
The king of kingsOPβ€’3y ago
The bug is located in the case 2
The king of kings
The king of kingsOPβ€’3y ago
I mean here
The king of kings
The king of kingsOPβ€’3y ago
I modified the code and it looks like this currently
Haze.
Haze.β€’3y ago
are you not going to have to do book.ToString() in there?
The king of kings
The king of kingsOPβ€’3y ago
You mean in the object? In the requirements it's mentioned that we can Use the ToString method directly.
Haze.
Haze.β€’3y ago
Well in the code you've shown you are never actually using this ToString method
The king of kings
The king of kingsOPβ€’3y ago
Really! How come? That's weird
Accord
Accordβ€’3y ago
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.

Did you find this page helpful?