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
Illusion [34]
3 years ago
13

Write a method named lastFirst that accepts a string as its parameter representing a person's first and last name. The method sh

ould return the person's last name followed by the first initial and a period. For example, the call lastFirst("Marla Singer") should return "Singer, M." . You may assume that the string passed consists of exactly two words separated by a single space.
Computers and Technology
1 answer:
Usimov [2.4K]3 years ago
7 0

I'm going to assume this is Java, because you said "method" meaning it will be some sort of object oriented language, and Java's really common. Here would be the full program, but you can just take the method out isolated if you need it.

package lastname;

public class LastName {

   public static void main(String[] args) {

       // Example usage:

       String name = LastName.lastName("Garrett Acord");

       System.out.println(name);

       // Output: Acord G.

   }

   public static String lastName(String fullName)

   {

       String[] splitName = fullName.split(" ");

       return String.format("%s %s.", splitName[1], splitName[0].substring(0,1) );

       

   }

   

}

You might be interested in
While many instruments have been "electrified", there is no such thing for the drums.
coldgirl [10]
False, because they are called percussion group
4 0
3 years ago
Read 2 more answers
Jonathan wants to create an online journal. He will use it to share with his friends all the cool places he visits while in Euro
nirvana33 [79]

Answer:

a blog

Explanation:

a forum is for questions, a wiki doesn't make sense in this situation and email wouldn't be used for this either so it should be a blog

7 0
3 years ago
Read 2 more answers
The ____ event of a ComboBox object is triggered when the user changes the selection.?
Semmy [17]
The "Selected Index Changed" event of a ComboBox object is triggered when the user changes the selection.
8 0
3 years ago
The ________ is the main switch station for memory; if the right and left areas are destroyed, the result is widespread amnesia.
Scorpion4ik [409]

Answer:

The answer is hippocampus.

Explanation:

The ___hippocampus._____ is the main switch station for memory; if the right and left areas are destroyed, the result is widespread amnesia. The __hippocampus.______ is the main switch station for memory; if the right and left areas are destroyed, the result is widespread amnesia.

4 0
3 years ago
Find the error in the following code fragment. int a: System.out.print(a):​
trapecia [35]

Answer:

If your using java, then its supposed to be "System.out.print("a")"    

Explanation:

its supposed to have quotations

7 0
2 years ago
Other questions:
  • Which web browser below is natively available on a major operating system? ie 10 opera firefox chrome?
    12·1 answer
  • Implement the function couple, which takes in two lists and returns a list that contains lists with i-th elements of two sequenc
    8·1 answer
  • One of the disadvantages of an e-marketplace is that it cannot provide a single platform for prices. true or false?
    10·2 answers
  • A computer has 9850 processes and 172 of them where suspended while 276 were terminated.,explain why some of the processes where
    15·1 answer
  • Use HTML to create a web page
    10·1 answer
  • Thomas came into work this morning and turned on his computer and nothing happened. He immediately called the help desk, and you
    5·1 answer
  • Fill in the blanks to complete a summary of this part of the passage. For the power of Patents
    6·2 answers
  • (Print distinct numbers) Write a program that reads in integers separated by a space in one line and displays distinct numbers i
    8·1 answer
  • By what decade were books readily available to the public across the United States and Europe?
    7·1 answer
  • Does my computer have virus?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!