Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions