Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

JavaScript Need Help with a JavaScript Problem.

Jimmy

New Coder
Good day all.
I need help with JavaScript (I did study it back in University over a decade ago).
I'm currently refreshing myself on the JavaScript syntax so everything's coming back to me.
The thing is I have a problem and the scope is beyond my capabilities. While i don't have any reference code to post here, I would like assistance in how to approach my problem and solve it.
My problem:
I can declare 5 items types and their quantity will be 15 each.
Of the 5 item types 1 of the items declared cannot be stored in the Container mentioned below.
I have 5 boxes - each box has 2 compartment and can store 5 of 1 item type and 3 of another item type. You can only store 2 different item types in each box.
eg. box1: item1 +5 and item 2 +3.
I have 1 container that can store 7 of 1 item type and 7 of another item type.
You can only store 2 different item types in this container.
You have 2 special containers.
Special Container 1 can store 12 of 1 item type.
Special Container 2 can store 9 of 1 item type.
Both Special Containers cannot store the same item type.

With the mentioned items above i want to be able to:
Declare the 5 item types.
eg. item1: Orange, item2: Apple etc.

I want to be able to select which box/ container/ special container i can place the items in.
Though I may only select for example 1 or 2 boxes, the rest of boxes or containers I don't select can then be filled in automatically with the declared items/ quantities.
eg.
box1: Orange +5, Apple +3
box2: Apple +5, Orange +3
box3: automatically filled with remaining items. (+5, +3)
box4: automatically filled with remaining items. (+5, +3)
box5: automatically filled with remaining items. (+5, +3)
Container: automatically filled with remaining items. (+7, +7)
Special Container1: automatically filled with remaining items. (+12)
Special Container2: automatically filled with remaining items. (+9)

tldr:
I want to allocate 5 item types with a total quantity of 75 to boxes/ containers of different storage capacities. This will be a calculator of sorts.

I'm not asking to be spoon fed code, i would like to solve the problem on my own(mostly).
I'm more interested in what specific areas of javascript i should focus my studies on to solve the problem. Also can anyone tell me how complex this problem is?

I'm sorry about the lengthy post and i do appreciate any assistance rendered in this thread.
 
Are you wanting a program to figure out how to do this or to do this after you know how to? I can tell you where things go and give you code that will do that, but not code to figure it out.
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom