University of Massachusetts Amherst [USI https//owl.oit.umass.edu/owlj/servlet/S
ID: 3880565 • Letter: U
Question
University of Massachusetts Amherst [USI https//owl.oit.umass.edu/owlj/servlet/Student?Ser. a nt?Serve Due Date: 2/4/2018 11:59 PM ore aboutv 2 Question Score: 00 of 1.0 Send s his kid Question: 2.15 d is Jim's kid? The complete program below creates an Infant named daleskid and then prints daleski d's age Using the ano thea Month method. alter the program so that daleakid is three months older. (Hint use anothexlMfon th mutiple times) on Jack'sk public class Test2 ( public static void main(Stringll args) ( capture this Infant dalesKid new Infant( Mary", 11); System.out.printin(Dales's Kid Age +dalesKid.getAge)) id is "Lizzie" and it object's state in t System.out.printin Updated Dales's Kid Age ) /iend mairn ) /lend class the values of on because of gas bath + daleskid.ge tAge) these changes, a CHECK ANSWERExplanation / Answer
public class Test2
{
public static void main(String[] args)
{
infant dalesKid = new infant("Mary",11);
System.out.println("Dales's Kid Age: "+dalesKid.getAge());
//using anotherMonth 3 times
dalesKid.anotherMonth();
dalesKid.anotherMonth();
dalesKid.anotherMonth();
System.out.println("Updated Dales's Kid Age: "+dalesKid.getAge());
}
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.