Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

undefined Overall Problem You and several friends decide to order some pizzas, and you agree to split the cost. It is assumed then that each

image text in transcribedundefined

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 twelve slices. Determine how many slices each may get. Hint: The simplest solution would use 5 different arithmetic operators, once each. Some more complicated solutions are error- prone! Sample Interfaces How many people are sharing pizza? 7 How many pizzas will be ordered? 2 You will divide 24 slices 4 will have 3 and 3 will have 4 How many people are sharing pizza? 6 How many pizzas will be ordered? 2 You will divide 24 slices 6 will have 4 and @ will have 5 How many people are sharing pizza? 5 How many pizzas will be ordered? 1 You will divide 12 slices 3 will have 2 and 2 will have 3. Exact spacing and spelling is not required -- correct calculation is far more important. All five of these computed values must appear in your program's results, for ALL reasonable inputs. There may be some cases, as shown above, where all the shares are equal; be sure that your result is correct (true) for those cases. Some people might limit themselves to 2 slices. Well, that just leaves the more for everyone else. For this option, assume that nobody will end up with fewer than 2 slices. Figure out how the pizza will be distributed. For example, How many people are sharing pizza? 7 How many pizzas will be ordered? 2 How many will limit themselves to two slices? 1 You will divide 24 slices -- 1 will have 2, 2 will have 3, and 4 will have 4 NOTE: Answering 0 to the third question results in the same effect as the original assignment. Those pursuing extra credit need not submit two separate programs

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: 3

blur-text-image

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

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

To solve p + 3q = 5z + tan( y - 3x)

Answered: 1 week ago