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...
-
The number N of locations of a popular coffeehouse chain is given in the table. (The numbers of locations as of June 30 are given.) (a) Find the average rate of growth (i) From 1996 to 1998 (ii) From...
-
Payment of the following year. At the end of 2022, Jonathan Willer's various types of income and deductions are as follows: Employment Income Eligible dividend received from a CPC Eligible dividend...
-
Consider the simple linear regression model fit to the copolyester viscosity data in Problem 2.14. Problem 2.14 Hsuie, Ma, and Tsai ("Separation and Characterizations of Thermotropic Copolyesters of...
-
Jennifer Willis worked for Coca Cola Enterprises, Inc. (CCE), in Louisiana as a senior account manager. On a Monday in May 2003, Willis called her supervisor to tell him that she was sick and would...
-
Assume we live in a single-factor world, where the market is the only factor and assets are correctly priced. The expected market return is 6%, and the risk-free rate is 3%. Consider a risky...
-
DM Yard Services has now added residential and commercial customers and is providing services on a regular basis. Review the Income Statement and Sales by Customer Summary Report: January 1 - May 31....
-
1. A forward contract is an agreement to buy or sell an asset at a certain future time for a certain price (called the forward price). At the time a forward contract is entered into by two parties,...
-
Which of the following describes a security issued by a local government agency? a. Acme, Inc. debenture bond b. Souderton County Water Authority bond c. 10-year Treasury bond d. Fidelity bond fund
-
Jose Fernandez is saving toward retirement and has an investment portfolio that reflects his risk tolerance. It was carefully put together by a trusted investment adviser. Unfortunately, the returns...
-
Tracy Quinn feels she has a great investment portfolio. She has investments in technology stocks, banking stocks, and consumer goods stocks. Which type of investment should she use if she is striving...
-
Common stockholders get paid before preferred stockholders if a firm goes out of business. True or False
-
Several investment strategies help investors select stocks. Dogs of the Dow is one of the most publicized strategies. Research this strategy and discuss whether it be a good investment strategy for...
-
A LED emits visible light when its OP-N junction becomes hot. P-N junction is reverse biased. depletion region widens. holes and electrons recombine.
-
Give codons for the following amino acids: (a) Th (b) Asp (c) Thr
-
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?
-
A company expects to receive which of the following benefits when it uses its budgeting process? a. The planning required to develop the budget helps managers foresee and avoid potential problems...
-
A direct materials budget would be used in which of the following types of companies? a. Service b. Merchandising c. Manufacturing d. All of the above
-
A disadvantage to merchants from accepting debit and credit cards would be a. lost sales. b. transaction fees. c. bounced checks. d. longer time to receive cash.
Study smarter with the SolutionInn App