Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3.12 Lab 3B: Pack a box (floor division) Overview Create a program using flooked division and the modulo operator Description Suppose you are working for

image text in transcribed
3.12 Lab 3B: Pack a box (floor division) Overview Create a program using flooked division and the modulo operator Description Suppose you are working for an online bookseller, who specializes in coffee table books with colorful pictures. You have customers who routinely order multiple books at a time. You need to figure out, given a customer's order, how many standard full boxes will need to be shipped and how many books are left over to be shipped in a smaller box Objectives The objectives of this lab are as follows to become familiar with floored division and the modulo operator to practice arithmetic expressions and assignment to variables to think about types and use type conversion to review input and output operators A standard shipping box is 18 inches long x 12 inches wide x 10.5 inches tall A standard size hardcover coffee table book is 16 inches long x 10 inches wide x 12 inches thick Bocks are stacked into the shipping boxes one on top of the other with one inch padding on each side. In other words, one book plus side padding will exactly fit into the bottom of the box. Your program will ask the user for the number of books the customer is ordening and then compute how many standard boxes will need to be shipped. Use one variable to keep track of the number of boxes Think about how you would solve this problem without a computer and write down the steps you need (the algorithm). Then translate that algorithm into a Python program Much of the program is already given to you. You should use floor division and the modulo operator to solve this problem Exif the input is 15, the output is We will need 1 standard boxes. There will be 7 books left to aap in a smaller box. Ex If the inputs 25. the outouti We will need 3 standard boxes. There will be 1 books left to ship sa maller box 301826.1742850 LAB ACTIVITY 2.12.1.Lab 38: Pack a box (loor division) 0725 main.py Load default template 18 compute number of boxes for given number of books 2 3 box_height = 10.5 4 book thickness - 1.2 5 6 compute the number of books per standard box Convert the result to an integert 7 books per box - 8 9 # now ask the user for the number of books the customer ordered 10 books ordered - 11 12 # compute the number of boxes needed. Store it in the variable called "num_bones" Develop made Submit mode Run your program as often as you like before submining for gradina Below type any needed input volues in the first box, then click Run program and observe the program is output in the second box Predefine program input (optional) stor open your provide them

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Question What are the requirements for a SIMPLE 401(k) plan?

Answered: 1 week ago