Question: Implement a python constructor that accepts one parameter: age (type integer). This parameter should initialize the similarly named class instance variable (these would start with

Implement a python constructor that accepts one parameter: age (type integer). This parameter should initialize the similarly named class instance variable (these would start with self. )

Implement a python method named sayHello. This python method should accept a single argument: name (type string). The result of this method should print the line

Hello, XXXX! Haven't seen you for YYYY years!

Where XXXX is the name supplied in the argument and YYYY is the class instance variable storing age, the one supplied during construction of the object.

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!