View the step-by-step solution to:

CMPSC 101 class i Need to program this problem using python 3.4.3. this is what i have so far people= int(input("How many people are sharing?"))

CMPSC 101 class i Need to program this problem using python 3.4.3.


this is what i have so far


people= int(input("How many people are sharing?"))

pizza_pie = int(input("How many pizzas will be ordered?"))

pizza_slice= pizza_pie *8

divide= pizza_slice//people

remainder= pizza_slice % people

Less= people- remainder

leftover= people-Less


people=5

pizza_pie=2


am i doing this right?






Overall Problem

You and several friends decide to order some pizzas, and you agree to split the cost. It is assumed then that each person will get a fair share of the purchase, so the problem is to figure out how many slices that is.

The pizza slices must be divided as equally as possible, but slices will not be further cut into fractions. It is possible that some will get one more slice more than others, but the difference must never be more than one.

You will be given the number of people involved, and the number of whole pizzas (where each pie is divided into eight slices. Determine how many slices each may get.

Hint: The simplest solution would use 5 different arithmetic operators, once each.

Sample Interfaces

How many people are sharing pizza? 5
How many pizzas will be ordered? 2
You will divide 16 slices -- 4 will have 3 and 1 will have 4


How many people are sharing pizza? 3 
How many pizzas will be ordered? 1 
You will divide 8 slices -- 1 will have 2 and 2 will have 3.

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question