I am having so trouble with % modular in one of my excercise. The problem starts with a wholesale company who will only ship case of 12 items, or master case of 144 items. That means if someone ordered one item, he will get one case of 12. <br>
Inputs:<br>
1. Number of items order 200<br>
2. Case Size 12<br>
4. Master Case Size 144<br>
5. Cost per case 1.5<br>
<br>
Outputs:<br>
1. Number of items order 200<br>
2. Case size 12<br>
3. Master case size 144<br>
4. Cost per items $ 1.5<br>
5. Number of case shipped 5<br>
6. Number of master case 1<br>
7. Number of items shipped 204<br>
8. Total cost of shippment 306.00<br>
<br>
Here are some of my problem:#include <iostream.h><br>
<br>
int main()<br>
<br>
{<br>
int Case, Mcase, num1, num2, items, total;<br>
Case = 12;<br>
Mcase = 12;<br>
<br>
num1 = items%Case;<br>
num2 = items%Mcase;<br>
<br>
if (num1 > 1)<br>
num1 = +1;<br>
else num1 = 0;<br>
<br>
<br>
<br>
<br>
<br>
cout << " Enter number of items you want to order: " <<endl;<br>
cin >> items;<br>
<br>
Case = (items/Case) + num1 ;<br>
cout << "number of case ordered " <<Case <<endl;<br>
Mcase = (items/Mcase) + num2;<br>
cout << "number of master case ordered " <<Mcase <<endl;<br>
<br>
<br>
<br>
}<br>
Inputs:<br>
1. Number of items order 200<br>
2. Case Size 12<br>
4. Master Case Size 144<br>
5. Cost per case 1.5<br>
<br>
Outputs:<br>
1. Number of items order 200<br>
2. Case size 12<br>
3. Master case size 144<br>
4. Cost per items $ 1.5<br>
5. Number of case shipped 5<br>
6. Number of master case 1<br>
7. Number of items shipped 204<br>
8. Total cost of shippment 306.00<br>
<br>
Here are some of my problem:#include <iostream.h><br>
<br>
int main()<br>
<br>
{<br>
int Case, Mcase, num1, num2, items, total;<br>
Case = 12;<br>
Mcase = 12;<br>
<br>
num1 = items%Case;<br>
num2 = items%Mcase;<br>
<br>
if (num1 > 1)<br>
num1 = +1;<br>
else num1 = 0;<br>
<br>
<br>
<br>
<br>
<br>
cout << " Enter number of items you want to order: " <<endl;<br>
cin >> items;<br>
<br>
Case = (items/Case) + num1 ;<br>
cout << "number of case ordered " <<Case <<endl;<br>
Mcase = (items/Mcase) + num2;<br>
cout << "number of master case ordered " <<Mcase <<endl;<br>
<br>
<br>
<br>
}<br>