Warehouse Assignment
I'm currently working on my warehouse assignment and I'm kinda stuck. The code is supposed to read line for the inventory file and sets each one to its own warehouse. It's printed after its read to show the starting stock of each warehouse All of the files are being read but the transaction part of the code isn't running. The purchase stock and selling stock parts of the code isn't running and I'm not sure what part is keeping it from doing so. I know this because the final shows the same amount of stock as the beginning of the day.
Here is the link to the code and the text files its supposed to interact with.
https://paste.mod.gg/rsqxlodzfnro/0
BlazeBin - rsqxlodzfnro
A tool for sharing your source code with the world!
9 Replies
Did you try debugging?
Well I know the second text file gets read but I'm not sure if my logic is off somewhere.
And debugging would help you figure out where
$debug
Tutorial: Debug C# code and inspect data - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
You can use the debugger to trace where the code execution is going, how the variables change, and anything else you want
i figured it out thank you!
turns out the delimeter was case sensitive so just doing ',' wasn't cutting it since in the text files i was reading it was actually ', ' but then i had to switch to ", " because the single quotes can do more than one character as a delimeter
Alternatively, you could've
.Trim()
med each elementAngius
REPL Result: Success
Result: string[]
Compile: 364.243ms | Execution: 23.727ms | React with ❌ to remove this embed.
Or, well, to be precise, no need to trim them. String split already has an option to trim them for you
That's what you see in the above snippet