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
Is anyone excited for the new matrix coming out ?
Vinil7 [7]

Answer:

Yes, me!!

Explanation:

5 0
3 years ago
Read 2 more answers
Client computers cannot function unless they are connected to the network because they cannot access an operating system.
Shtirlitz [24]

Answer: true

Explanation:

As the operating system cannot run from an external device and in a distributed operating system all the clients needs to be connected to the network to share resources via the distributed or network operating system.

8 0
3 years ago
How do I turn on your asus chromebook flip?
galben [10]
I believe the charger has to be connected for it to turn on.
3 0
3 years ago
PLZ HELP HELP HELP ME I NEED ANSWER MATH​
irina [24]

The first one is 0 (0/3=0)

The second one is 3 (3/3=1)

The third one is 2 (6/3=2)

The fourth one is 9 (9/3=3)

Hope this helps you :)

4 0
3 years ago
Read 2 more answers
Financial stability is when u what
Mila [183]

Are in good standing money wise!

hope helped c;

3 0
3 years ago
Read 2 more answers
Other questions:
  • Explain what might happen if two stations are accidentally assigned the same hardware address?
    15·1 answer
  • In your own words, describe what Internet Protocols are. Why is it important to have agreed upon protocols?
    6·1 answer
  • This program has some errors in it that are needed to be checked import java.io.*;
    13·1 answer
  • Assume you are a network consultant for a company that is designing a private WAN to communicate between five locations spread t
    10·1 answer
  • Write down a program in SNOBOL thatcalculates the factorial of 7.
    10·1 answer
  • Many major employers routinely monitor the performance of their employees through the computers and telephones they use. Employe
    12·1 answer
  • Students who finish their homework after school are meeting a. intrapersonal and short-term goals b. normative and short-term go
    13·2 answers
  • Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (a
    14·1 answer
  • Before performing a Web Recorder task, which two options should the user ensure are setup correctly?
    6·2 answers
  • 2+2? D: I don't knoww​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!