1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
riadik2000 [5.3K]
3 years ago
9

Write a method for the Invitation class that accepts a parameter and uses it to update the address for the event.

Computers and Technology
1 answer:
DerKrebs [107]3 years ago
6 0

Answer:

public class Invitation {

 private String hostname;

 private String address;

  public Invitation(String n, String a) {  // constructor that accepts two strings.

   hostname = n;

   address = a;

 }

  public String getHostname() {

   return hostname;

 }

 public void setAddress(String a) {

   address = a;

 }  

 public String invite(String guest) {

   return "Hello" +guest+ ", you are invited to my party at " +address+". "+hostname+".";

 }

 public Invitation(String host, String address) {

   this.address = address;

   this.hostname = host;

 }

}

Explanation:

The Java program defines a class called "Invitation". The class constructor has two string arguments or parameters for the host of the event and the address. The invite method is used to generate the string invite message with the name of the guest as the argument. Use the "setAddress" method to set a new location of the event and the "getHostname" to get the name of the event host.

You might be interested in
Any movie/show suggestions??
trasher [3.6K]
The office is a good one. If you haven’t ever watched it
6 0
3 years ago
Read 2 more answers
The function below takes a single string parameter: sentence. Complete the function to return everything but the middle 10 chara
dolphi86 [110]

Answer:

def get_middle_ten(sentence):

   ind = (len(sentence) - 12) // 2

   return sentence[ind:ind + 12]

# Testing the function here. ignore/remove the code below if not required

print(get_middle_twelve("abcdefghijkl"))

print(get_middle_twelve("abcdefghijklmnopqr"))

print(get_middle_twelve("abcdefghijklmnopqrst"))

7 0
3 years ago
Write down the appropriate technical term of following statements.​
MrRa [10]

Answer:

it is not seeing full. please give full

8 0
3 years ago
Driving at slower speeds than traffic flow _____________ .
UNO [17]
The answer is B. may impede other vehicles on the road that are traveling at a normal and safe speeds
4 0
3 years ago
What affect did the Scopes trial have on the school curriculum in Tennessee?
Bad White [126]
D)It did not change the curriculum because Scopes lost the case.
4 0
3 years ago
Read 2 more answers
Other questions:
  • Which principle of design is she following
    9·1 answer
  • _____ are likely to support bigger government, social welfare programs, and legalized abortion.
    8·2 answers
  • Data means a group of numbers. <br> a. True<br> b. False
    7·1 answer
  • Part B: Find the value of G: if A = 3, b=4, and C = 5.
    11·1 answer
  • What has information technology made piracy possible?
    14·1 answer
  • Given an array of n distinct integers,d = [d[0], d[1],.., d[n - 1]], and an integer threshold, t, how many (a,b,c) index triplet
    11·1 answer
  • 2 (01.01 LC)
    5·1 answer
  • In the __________ Standard, chemical manufacturers, importers, and distributors are required to provide hazard information by wa
    10·1 answer
  • Which of the following would be better communicated with an image than with text?
    9·1 answer
  • Which type of information could be displayed using this line graph?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!