Question: is my answer correct? Given the following code: public class person { private int age; private string status; private string name; public Person ( )

is my answer correct?
Given the following code:
public class person {
private int age;
private string status;
private string name;
public Person(){
this.status = "young";
this. age =0;
this. name = "Unnamed Person";
}
public int getage(){
return this.age;
}
public string getName(){
return
this.name;
}
public void setName(String name){
this. name = name;
}
public void getolderByYears(int years){
this.age = this .age + years;
if (this.age >10){
this.status = "old";
}
}
}
Part 1
Which of the following clauses should be included in the specification of the constructor for the Person
class?
(a) MODIFIES
(b) REQUIRES
(c) EFFECTS
Select all possible options that apply.
Part 2
Which of the following clauses should be included in the specification of the setwame method of the
Person class?
(a) EFFECTS
(b) MODIFIES
(c) REQUIRES
Select all possible options that apply.
Part 3
Which of the following clauses should be included in the specification of the getolderbyrears method of
the Person class?
(a) EFFECTS
(b) MODIFIES
(c) REQUIRES
Select all possible options that applyJA ASDFA.
 is my answer correct? Given the following code: public class person

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!