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

  • Use only if else nested if else only otherwise your answer won't be entertained. Problem 1(b):...

    Use only if else nested if else only otherwise your answer won't be entertained. Problem 1(b): Write a program that gives remainder without using modulus operator and loops. The first number entered will be dividend and second number entered will be divisor. Sample input: 15 6 Sample output: Remainder is 3 In a right triangle, the square of the length of one side is equal to the sum of the squares of the length of the other two sides. Write...

  • 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...

  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

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
ADVERTISEMENT