Question

Your work for company ships flour to customers in cubic boxes of various sizes. Set of...

Your work for company ships flour to customers in cubic boxes of various sizes. Set of boxes you have available all have sides with lengths in inches that are even but not divisible by 3, eg(2,4,8,14,16,20,etc).

Write Matlab program that prompts user for an amount of flour in cubic inches and finds the lenghts of the side of the smallest box you have that is large enough to ship the flour. Display the box size to use.

(This question is Matlab subject, could you help me to write in Matlab software through computer to find the answer)

thanks

0 0
Add a comment Improve this question Transcribed image text
Answer #1
flour = input('Enter amount of flour in cubic inches: ');
side = ceil((flour)^(1/3));
if mod(side, 2) == 1
side = side + 1;
end
if mod(side, 3) == 0
side = side + 1;
if mod(side, 2) == 1
side = side + 1;
end
end
fprintf('The lenght of the sides of the smallest box you have that is large enough to ship the flour: %d', side);

Add a comment
Know the answer?
Add Answer to:
Your work for company ships flour to customers in cubic boxes of various sizes. Set of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. Suppose you are working in an airline company. Customers check baggage with various sizes and...

    1. Suppose you are working in an airline company. Customers check baggage with various sizes and weights. Each piece of baggage has its own dimensions (length, width, height) as well as weight. You will write a Java program that allows the airline staff to input baggage dimensions and weight information. The computer will determine if the baggage is allowed to be checked in. If it is allowed, the system will then calculate the price based on the size and weight....

  • Sing to your answers and simplify your answers whenever possible. 1. A shipping company offers various...

    Sing to your answers and simplify your answers whenever possible. 1. A shipping company offers various sized shipping boxes to its customers. Some of these boxes are cube-shaped, with equal height, width, and depth. As part of an upcoming sales promotion, the company will offer two cube-shaped boxes for the price of one. a. Write an expression to represent the total volume of two different sized boxes as a sum of cubes if one of the boxes has sides with...

  • Boxes Task: Evaluate whether you can load various sizes of jars into boxes. For each test,...

    Boxes Task: Evaluate whether you can load various sizes of jars into boxes. For each test, you will input the length, width, and height of a box as well as the diameter and height of a cylindrical jar. The algorithm will determine whether each jar will fit in its corresponding box. The jar can sit upright in the box, or it can lie on its side with its top parallel to one of the sides of the box.   Assume that...

  • C++ Lone Star Package Service ships packages within the state of Texas. Packages are accepted for...

    C++ Lone Star Package Service ships packages within the state of Texas. Packages are accepted for shipping subject to the following restrictions: Shipping requirements The package weight must not exceed 50 pounds. The package must not exceed 3 feet in length, width, or height. The girth of the package must not exceed 5 feet. The girth is the circumference around the two smallest sides of the package. If side1, side2, and side3 are the lengths of the three sides, and...

  • code in java please:) Part I Various public transporation can be described as follows: A PublicTransportation...

    code in java please:) Part I Various public transporation can be described as follows: A PublicTransportation class with the following: ticket price (double type) and mumber of stops (int type). A CityBus is a PublicTransportation that in addition has the following: an route number (long type), an begin operation year (int type), a line name (String type), and driver(smame (String type) -A Tram is a CityBus that in addition has the following: maximum speed (int type), which indicates the maximum...

  • In Problem Set 7 you designed and implemented a Message class. This time, let's design and...

    In Problem Set 7 you designed and implemented a Message class. This time, let's design and implement a Mailbox class in a file named Mailbox java. Do the following with this class • You may use the Message class from PS 7. You will have to add new features to the Message class from PS 7 as you work through this problem. You are welcome to start with my sample solution if you wish • Suppose there are multiple mail...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT