Max enjoys hosting pizza parties for his friends. Unfortunately, some of Max's friends eat much faster...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Max enjoys hosting pizza parties for his friends. Unfortunately, some of Max's friends eat much faster than the others, leaving the slower eaters hungry. Max would like to divide the pizza evenly amongst his friends instead, but he is very bad at maths. To address this problem, Max is asking you to write him a program which calculates how many slices each person should receive. The program should ask for two inputs. The first input is the total number of pizza slices. The second input is the total number of people at the party. Your program should then calculate the number of whole slices per person. Max does not own a pizza cutter, so partial slices are not allowed (e.g., 1.5 slices each is not possible). How do we calculate this value? Well, the number of slices per person is equal to the integer division of the total number of slices by the total number of people. Finally, your program should print the result in the following format (where X is the value that you calculated): X per person Hints Here's an example of the intended program behaviour to help you plan .. 1 #Write your program here. Feedback Custom Input Type input here Debug ??? Show details... Assess???? Reset Code Expected output Type expected output here Actual output Evaluate ? -/3 -/4 Submit (e.g., 1.5 slices each is not possible). How do we calculate this value? Well, the number of slices per person is equal to the integer division of the total number of slices by the total number of people. Finally, your program should print the result in the following format (where X is the value that you calculated): X per person Hints Here's an example of the intended program behaviour to help you plan your algorithm, assuming that there are 10 slices and 4 people: 1. Accept 10 as input. 2. Accept 4 as input. 3. Integer divide 10 by 4, which gives 2. 4. Build and print the output message 2 per person I recommend using three variables in your solution---one for each of the two inputs, and one for the result of the integer division. In Python, integer division is achieved using the // operator (as opposed to 7, which is regular division). Don't forget about data types. In order to do mathematics with whole numbers, you need integers (int). In order to build output messages with text, you need strings (str). 1 2 # Write your program here. Feedback Custom Input Type input here Debug ??? Show details... Assess ?? ?? Reset Code Expected output Type expected output here Actual output Evaluate ********....... ? -/3 -/4 Submit . Max enjoys hosting pizza parties for his friends. Unfortunately, some of Max's friends eat much faster than the others, leaving the slower eaters hungry. Max would like to divide the pizza evenly amongst his friends instead, but he is very bad at maths. To address this problem, Max is asking you to write him a program which calculates how many slices each person should receive. The program should ask for two inputs. The first input is the total number of pizza slices. The second input is the total number of people at the party. Your program should then calculate the number of whole slices per person. Max does not own a pizza cutter, so partial slices are not allowed (e.g., 1.5 slices each is not possible). How do we calculate this value? Well, the number of slices per person is equal to the integer division of the total number of slices by the total number of people. Finally, your program should print the result in the following format (where X is the value that you calculated): X per person Hints Here's an example of the intended program behaviour to help you plan .. 1 #Write your program here. Feedback Custom Input Type input here Debug ??? Show details... Assess???? Reset Code Expected output Type expected output here Actual output Evaluate ? -/3 -/4 Submit (e.g., 1.5 slices each is not possible). How do we calculate this value? Well, the number of slices per person is equal to the integer division of the total number of slices by the total number of people. Finally, your program should print the result in the following format (where X is the value that you calculated): X per person Hints Here's an example of the intended program behaviour to help you plan your algorithm, assuming that there are 10 slices and 4 people: 1. Accept 10 as input. 2. Accept 4 as input. 3. Integer divide 10 by 4, which gives 2. 4. Build and print the output message 2 per person I recommend using three variables in your solution---one for each of the two inputs, and one for the result of the integer division. In Python, integer division is achieved using the // operator (as opposed to 7, which is regular division). Don't forget about data types. In order to do mathematics with whole numbers, you need integers (int). In order to build output messages with text, you need strings (str). 1 2 # Write your program here. Feedback Custom Input Type input here Debug ??? Show details... Assess ?? ?? Reset Code Expected output Type expected output here Actual output Evaluate ********....... ? -/3 -/4 Submit .
Expert Answer:
Related Book For
Smith and Roberson Business Law
ISBN: 978-0538473637
15th Edition
Authors: Richard A. Mann, Barry S. Roberts
Posted Date:
Students also viewed these programming questions
-
In class, we argued that to describe a mixture with nc components in VLE, we need 2n, thermodynamic variables: T, P, ne - 1 mole-fractions, {x}, and ne 1 mole-fractions, {y}. Then, using the VLE...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
Professor Quark opens his own company, Electronic Tutorial Services, and completes the following transactions in June: 6/1 Quark invests 24,000 into the business. 6/3 Purchased 2,100 of equipment on...
-
Two air carts of mass m1 = 0.84 kg and m2 = 0.42 kg are placed on a frictionless track. Cart 1 is at rest initially, and has a spring bumper with a force constant of 690 N/m. Cart 2 has a flat metal...
-
You may have heard that most car accidents happen within 25 miles of home. The data provided in Table 2.10 is the mileage away from home for a random sample of 36 car accidents that occurred over the...
-
\(15 \times 39\) Use properties of real numbers and mental math to calculate the expression.
-
The normal capacity of a factory is 8,000 units per month. Cost and production data follow: Standard application rate for fixed overhead . . . . . . . . . . . . . . . . . . $0.50 per unit Standard...
-
A project requires an initial investment in equipment of $90,000 and then requires an investment in working capital of $10,000 at the beginning (t = 0). The project is expected to produce sales...
-
Griffin and Lasky, Inc. (G&L), supplies industrial automation equipment and machine tools to the automotive industry. G&L recognizes revenue on its long-term contracts over time. Customer orders have...
-
E22.2: Let C be the boundary of the unit square [0,1] [0, 1] in R, oriented counterclockwise, and let be the vector field F(x,y) = (e +x, x y). Evaluate the line integral F. dr. -
-
As of June 3 0 th , H Co . has assets of 1 0 0 , 0 0 0 $ and owners ewuity if 5 , 0 0 0 $ . What are the liabilities for H Co . as of June 3 0 th ?
-
3. (20pts): What is the time complexity of the functions below? Time complexity Code a) def test(n): for i in range(n): for j in range(n): print(i, j) b) def test(n): for i in range(n): print(i) for...
-
Sheffield Corp. manufactures and sells high-priced motorcycles. The Engine Division produces and sells engines to other motorcycle companies and internally to its Retail Division. It has been decided...
-
What are the key indicators of successful organizational change implementation, and how can organizations measure and evaluate their progress toward desired outcomes effectively ?
-
2. Consider the 2 DOF system below, with m = m, and m = 2m. The system has the following initial conditions: x (0) = 5, x (0) = 2, (0) = 1, x (0) = 0. There are no frictional forces. a. Compute the...
-
Jackson has accumulated $3200 in savings and wishes to invest this money sensibly. The types of investments and their corresponding percentages, recommended by a financial advisor, are shown in the...
-
Quadrilateral EFGH is a kite. Find mG. E H <105 G 50 F
-
This case originated as a garden-variety, state-law-based contract action: Discover sued its cardholder, [Betty] Vaden, in a Maryland state court to recover arrearages amounting to $10,610.74, plus...
-
Discuss the potential civil and criminal liability of an accountant under the 1934 Act.
-
For what and to whom does an accountant have tort liability?
-
Repeated Discounts. In this exercise, we explore applying more than one discount to an item. Suppose a store cuts the price on an item by \(50 \%\), and then offers a coupon for \(25 \%\) off any...
-
Unit Conversion. There are 12 inches in a foot, 3 feet in a yard, and 1,760 yards in a mile. Convert 10 miles to inches. To do so, first convert miles to yards. Next, convert the yards to feet. Last,...
-
Convert \(0 . \overline{7}\) to fraction form.
Study smarter with the SolutionInn App