Question: 1. Given the Person class below, create a Greeter class with a single static method named greet. This method should: Accept one parameter named people

1.

Given the Person class below, create a Greeter class with a single static method named greet. This method should:

Accept one parameter named people that is a list of Person objects.

Create a list of greetings (strings). There will be one greeting per person. Each should say "Hello FIRST LAST!", where "FIRST" and "LAST" are replaced with the values from the person (firstName and lastName).

Return the array of greetings.

For instance, if the input to the static greet method of the Greeter class were two people named "Bill Barnes" and "Sally Smith", the result would be an array of two Strings:

"Hello Bill Barnes!" "Hello Sally Smith!" 

The Person class is defined as follows (you do not need to add this to your code):

class Person: """This is a person""" def __init__(self, firstName, lastName): """Initializer""" self.firstName = firstName self.lastName = lastName

2.

Create a class named Rectangle that:

Has two properties width and height.

Has an initializer to set the two properties.

Has a method named area() that has no parameters (other than self) and returns the area of the rectangle (the product of the width and height).

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!