Question: create a new file named MethodsPractice.java. A)-->>Within MethodsPractice.java, write a method named planParty(int f, int c, int p) that computes and displays the number of

create a new file named MethodsPractice.java.

A)-->>Within MethodsPractice.java,write a method named planParty(int f, int c, int p)that computes and displays the number ofp-packs needed to supply a party for you andfof your friends, each of whom will drinkccans. The method should also compute and display how many extra cans youll have. Note that this method should onlyprintits results on the screen; it does notreturnany value.

Here are some example arguments for the planParty method and their expected output on the screen:

Arguments

Output on Screen

(9, 14, 6)

24 pack(s) needed

4 extra can(s)

(4, 6, 3)

10 pack(s) needed

0 extra can(s)

(4, 6, 4)

8 pack(s) needed

2 extra can(s)

B)--->> Within MethodsPractice.java,write a method named planParty2(int f, int c, int p)that performs the same calculations as the previous part, butreturnsthe number ofp-packs needed. planParty2 does not need to consider the number of extra cans, and it should not print anything.

Here are some example arguments for the planParty2 method and their expected return values:

Arguments

Return Value

(9, 14, 6)

24

(4, 6, 3)

10

(4, 6, 4)

8

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 Programming Questions!