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 one, then the output is:
Expected number of people:
The family needs a room for one.
import java.util.Scanner;
public class Familysize
public static void printFamilysizeint familysize
System.out.printlnExpected number of people: familysize;
Y Your code goes here
public static void mainString args
Scanner scnr new Scanner
System.in;
int sizeoffamily;
String sizeInword;
sizeoffamily scnr nextInt;
sizeInword ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
