division and modulus

I am new to programming in C++ and I welcome challenges. I am writing a program that you input the number of items you are trying to ship and it divides the shipment into various size container by amount it can hold for packing. I know the formulas, what I am having trouble with is the syntax in coding. I am not sure on how to write the code. Basically : It would say how many items to ship?
you would input a number(N) then there are 4 constants that (N) would be divided by with each whole number equal to a shipping container and the modulus(%) being carried to the next level. so it would be
(N)/50 if product >1 then *1//huge boxes
(%)=remainder1; remainder1/20 if product >1 then *1//large boxes
(%)=remainder2; remainder2/5 if product >1 then *1//medium boxes
(%)=remainder3; remainder3/1 if product >1 then *1//small boxes

It would send to screen the number of boxes to screen.
I need help with the mathmatical aspect of the codesI have been racking by brain trying to figure out how to format the code for this portion any help would be greatly appreciated. Thank you
You pretty much have it.

1
2
3
4
huge = N/50;
rem1 = N%50;
large = rem1/20;
rem2 = rem1%20;


etc.
oh ok. maybe I am over thinking this but with:
huge = N/50 // this will give me the results for how many huge containers I will need
rem1 = N%/50; // this will give me the remainder of N/50 and assign it to rem1?
large = rem1/20; //this will give me the results for how many large containers I will need
rem2 = rem1%/20; //this will give me the remainder of rem1/20 and assign it to rem2?
med = rem2/5; //this will give me the results for how many medium containers I need
rem3 = rem2%/5; //this will give me the remainder of rem2/5 and assign it to rem3?
small = rem3/1; //this will give me the amount of small contains that are needed
Yes but it isn't "%/" its just "%" for the modulo operation.
I have a new problem this is my code:

remainder1 = number % 50;
//this will give me the results for how many large containers I will need
large = (remainder1/20);
//this will give me the remainder of rem1/20 and assign it to rem2?
remainder2 = (remainder1%20);
//this will give me the results for how many medium containers I need
medium = (remainder2/5);
//this will give me the remainder of rem2/5 and assign it to rem3
remainder3 = (remainder2%5);
//this will give me the amount of small contains that are needed
small = (remainder3/1);

I am getting this error message
29 C:\Documents and Settings\Scheon\Desktop\CSC134\lab1.cpp expected `;' before "remainder1"

what am i doing wrong?


I found it thanks I didn't close off one of my lines
Topic archived. No new replies allowed.