Question: Write a class with name Learner which meets the following requirements: There is a constructor which takes two parameters: name of type String and bodysize

Write a class with name Learner which meets the following requirements:
There is a constructor which takes two parameters: name of type String and bodysize of type Integer.
There is a method getName() which returns name of the person.
There is a method getBodysize() which returns bodysize of the person.
There is a method growBody(nSizes) which increases the bodysize by nSizes.
For example:
Test Result
john = Learner("John Doe", 160)
print(john.getName()+""+ str(john.getBodysize()))
john.growBody(1)
print(john.getName()+""+ str(john.getBodysize()))
John Doe 160
John Doe 161
Answer:(penalty regime: 0%)

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 Programming Questions!