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
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
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"