Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started