Question: The method printFamilySize ( ) has an integer parameter. Define a second printFamilySize ( ) method that has a string parameter. The second method outputs

The method printFamilySize() has an integer parameter. Define a second printFamilySize() method that has a string parameter. The second method outputs the following in order, all on one line:
"The family needs a room for "
the value of the string parameter
:'
End with a newline.
Ex. If the input is 1 one, then the output is:
Expected number of people: 1
The family needs a room for one.
import java.util.Scanner;
public class Familysize {
public static void printFamilysize(int familysize){
}
System.out.println("Expected number of people: "+ familysize);
Y* Your code goes here */
public static void main(String[] args){
Scanner scnr = new Scanner(
System.in);
int sizeoffamily;
String sizeInword;
sizeoffamily = scnr. nextInt();
sizeInword =scnr*next();
 The method printFamilySize() has an integer parameter. Define a second printFamilySize()

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!