#Inventory System Management

1 messages ยท Page 1 of 1 (latest)

smoky vaultBOT
#

<@&987246399047479336> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question ๐Ÿค–. Maybe it helps! In any case, a human is on the way ๐Ÿ‘. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#
TJ-Bot
Need help with some methods for my inventory system management program.

Sure! Here are some methods you can consider implementing for your inventory system management program:

  1. Add item: Create a method that allows users to add new items to the inventory. This method should take parameters such as item name, quantity, and price.

  2. Remove item: Implement a method that allows users to remove items from the inventory based on their name or ID.

  3. Update item quantity: Create a method that allows users to update the quantity of an existing item in the inventory.

  4. Update item price: Implement a method that allows users to update the price of an existing item in the inventory.

  5. Search item: Create a method that allows users to search for items in the inventory by name or ID.

  6. Display all items: Implement a method that displays all items currently in the inventory, including their names, quantities, and prices.

  7. Generate report: Create a method that generates a report of the current state of the inventory, including total number of items and their total value.

By implementing these methods, you can efficiently manage your inventory system and keep track of all items effectively. Let me know if you need any further assistance with implementing these methods!

fast yarrow
#

u can just drag drop ur files here btw. our bot will make sure its nice then

smoky vaultBOT
# lucid phoenix

I uploaded your attachments as Gist. This makes them more accessible, for example to mobile users.

fast yarrow
#

i know u wanted to do vc but if no one joins and u want to give chat a try it would be nice if u can guide us a bit through the code and explain what ur doing that leads to the error, providing some much needed context ๐Ÿ™‚

celest sand
lucid phoenix
#

ok, so i am using auto to initiate the list of cars with their inherited attributesd, and car is the single object of each car with thos eattributes

celest sand
#

public Auto(String csvFilePath) {
auto = new Auto(csvFilePath);
}

#

this code

lucid phoenix
#

im just a little confused, i normally rely on AI to help me code (which was a learning mistake) but now i have to do it on my own for this mock interview

celest sand
#

you are asking auto top create itself to create itself to create itself...

raven leaf
#

you got a recursion issue, the constructor of Auto is using the same constructor in the implementation
which basically infinitely calls the same method resulting in a StackOverflow

lucid phoenix
#

ohhhhhhh

#

ok

celest sand
#

note that StackOverflow is usually caused by infinite recursive call

#

and the stacktrace usually shows this

#
at Auto.<init>(Auto.java:6)
at Auto.<init>(Auto.java:9)
at Auto.<init>(Auto.java:9)
at Auto.<init>(Auto.java:9)
at Auto.<init>(Auto.java:9)
at Auto.<init>(Auto.java:9)
#

look

#

auto calls itself which calls itself...

lucid phoenix
#

ok

#

i changed it to:

public class Auto {
    private final Auto auto = null;
    Scanner scanner = new Scanner(System.in);

    public Auto(String csvFilePath) throws IOException {
        this.run();
        try {
            Inventory.loadFromCSV(csvFilePath);
        } catch (IOException e) {
            System.out.println("Error loading cars from file: " + e.getMessage());
        }
    }

    void run() throws IOException {
        Inventory.loadFromCSV(Inventory.csvFilePath);
smoky vaultBOT
lucid phoenix
#

but

#

now it says no cars found

fast yarrow
#

why does auto have an auto member

lucid phoenix
#

to initialize

fast yarrow
#

that makes little sense to me

candid flare
#

What does it represent?

fast yarrow
#

codewise that means ur saying that an auto contains a second auto within itself

lucid phoenix
#

oh

#

so should i do

#

auto conatining car?

fast yarrow
#

and that second auto, guess what, contains another auto as well and that... forever

#

its a bit hard to really help u out of this without understanding what ur even trying to do

#

nor knowing what u thought ur code would do

lucid phoenix
#

dude im so confused

#

im trying to initialize the csv file

#

so the user can use it

#

it worked on my other program

fast yarrow
#

okay but that won't move us closer to the solution

#

ull have to sit down and explain in detail what u wanted ur code to do. so that we can review it and tell u where it's not doing that

#

so that it can then be fixed

lucid phoenix
#

is there any chance u can hop in call w me?

fast yarrow
#

i definitely can't

#

and most people on this server arent down to that. but some are. so u could also wait for them ๐Ÿ™‚

lucid phoenix
#

ok, ill look on chat and see if i can figure it out

#

thank you for the help though! i appreciate it

candid flare
#

Your CSV contains a list of cars, each line is a car. So your car should not contain a car.

smoky vaultBOT
# lucid phoenix Updates:

I uploaded your attachments as Gist. This makes them more accessible, for example to mobile users.