subject

Print person1's kids, call the incNumKids() method, and print again, outputting text as below. End each line with a newline. Sample output for below program with input 3:
Kids: 3
New baby, kids now: 4
// Code from file PersonInfo. java
public class PersonInfo {
private int numKids;

public void setNumKids(int setPersonsKids) {
numKids = setPersonsKids;
}

public void incNumKids() {
numKids = numKids + 1;
}

public int getNumKids() {
return numKids;
}
}
// end

// Code from file CallPersonInfo. java
import java. util. Scanner;

public class CallPersonInfo {
public static void main(String [] args) {
Scanner scnr = new Scanner(System. in);
PersonInfo person1 = new PersonInfo();
int personsKid;

personsKid = scnr. nextInt();

person1.setNumKids(personsKid);

/* Your solution goes here */

}
}
// end

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 1
question
Computers and Technology, 23.06.2019 04:00
In a word processing program, such as microsoft word, which feature to you choose the desired picture enhancement?
Answers: 2
question
Computers and Technology, 23.06.2019 04:31
Which of the following is not a way in which trees benefit the environment? a. they remove a significant amount of carbon dioxide from the atmosphere. b. they remove a significant amount of oxygen from the atmosphere. c. their roots hold soil in place, reducing rates of erosion. d. they remove ozone and particulates from the atmosphere. select the best answer from the choices provided a b c d
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
This chapter lists many ways in which becoming computer literate is beneficial. think about what your life will be like once you’re started in your career. what areas of computing will be most important for you to understand? how would an understanding of computer hardware and software you in working from home, working with groups in other countries and contributing your talents.
Answers: 1
You know the right answer?
Print person1's kids, call the incNumKids() method, and print again, outputting text as below. End e...
Questions
question
Mathematics, 02.05.2021 18:50
question
Mathematics, 02.05.2021 18:50
Questions on the website: 13722363