A flower store in boxes such that a dozen are placed in each

A flower store in boxes such that a dozen are placed in each box. The store is expecting three separate shipment of 751 flowers, 1258 flowers and 1456 flowers over three consecutives days. After shipment comes in, the boxes are filled with flowers but not shipped unless they are completely filled. Any flowers not shipped are held until next day\'s shipment arrives and then shipped out. On the third day, all flowers are shipped in boxes whether or not the boxes are filled. Using the appropriate rounding functons, write a MATLAB program that determines how many boxes of flowers are shipped each of the three days.

Solution

Matlab code:

d_1 = 751;
d_2 = 1258;
d_3 = 1456;

r = mod(d_1, 12);
fprintf(\'Number of boxes shipped on day1 %d\ \', (d_1 - r)/12);
d_2 = d_2 + r;
r = mod(d_2, 12);
fprintf(\'Number of boxes shipped on day2 %d\ \', (d_2 - r)/12);
d_3 = d_3 + r;
r = mod(d_3, 12);
fprintf(\'Number of boxes shipped on day2 %d\ \', (d_3 - r)/12 + 1);

Sample output:

A flower store in boxes such that a dozen are placed in each box. The store is expecting three separate shipment of 751 flowers, 1258 flowers and 1456 flowers o

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site