Question: (4 pts) Problem 3 Suppose you're throwing a wild party for yourself and 9 of your closest friends. Since this party is wild. you expect

 (4 pts) Problem 3 Suppose you're throwing a wild party for

(4 pts) Problem 3 Suppose you're throwing a wild party for yourself and 9 of your closest friends. Since this party is wild. you expect each person (including yourself) to drink 14 cans of uh... strawberry juice. You don't want to disappoint any of your friends (or yourself), so you need to make sure there's enough strawberry juice available: 10 people 14 cans/person-140 cans. But you can't just buy strawberry juice in individual cans - it's sold only in 6-packs. Thus, you need to buy at least 24 of those 6-packs (giving you a total of 144 cans) to satisfy everyone. The extra 4 cans can be saved for next time, or perhaps used as an incentive to encourage your guests to help you clean up afterward. After throwing several of these parties, you're getting tired of doing the math yourself every time. Let's do the computer scientist thing and generalize the problem so we can write a program to solve it. You want to throw a party for f friends, each of whom will drink c cans of a wholesoue, healthy beverage which is sold only in p-packs. (As before, ussume that you'll partake in the drinking yourself too.) Within your Lab2HW folder, write a program and p. The program should then report the minimum number of p-packs that need to be bought, along with the number of extra cans (if any) that you'll have. The program should also allow you to enter the name of the drink (as a string) and include that name in its results. named PartyPlanner.java that reads user iuput for f, c

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!