Answered step by step
Verified Expert Solution
Link Copied!

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 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();
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions