Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
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

Recommended Textbook for

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

8. Rework Exercise 6 assuming a subgroup size of 3.

Answered: 1 week ago

Question

Fill in the Chart please. Ratio Analysis Formula Cheat sheet

Answered: 1 week ago