Respuesta :
(a) A method for the Invitation class that returns the name of the host.
public String getHostName() {
return hostName;
}
(b) A method for the Invitation class that accepts a parameter and uses it to update the address for the event.
public void updateAddress(String newAddress) {
address = newAddress;
}
(c) A method for the Invitation class that will accept the name of a person who will be invited as a string parameter and return a string consisting of the name of the person being invited along with the name of the host and location of the event.
public String generateInvitation(String name) {
return "Dear " + name + ", please attend my event at " + address + ". See you then, " + hostName + ".";
}
For more questions like Invitation method click the link below:
https://brainly.com/question/16344360
#SPJ4
Complete question:
Invitation FRQ The following class represents an invitation to an event. The variable hostName represents the name of the host of the event and the variable address represents the location of the event.
public public class Invitation private String hostName; private String address; public Invitation(String n, String a) 1 hostName = ni address = a; > 1 (a) Write a method for the Invitation class that returns the name of the host. (b) Write a method for the Invitation class that accepts a parameter and uses it to update the address for the event. (C) Write a method for the Invitation class that will accept the name of a person who will be invited as a string parameter and return a string consisting of the name of the person being invited along with name of the host and location of the event. Your implementation must conform to the example below. EXAMPLE If the host name is "Dana", the party location is "1234 Daechi Street", and the person invited is "Lorena", the method should return a string in the following format. Dear Lorena, please attend my event at 1234 Daechi Street. See you then, Dana