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
Please give me correct answer<br><br>please give me very short answer​
Anna35 [415]

Answer:

1.A table is a range of data that is defined and named in a particular way.

2.Table tools and layout

3.In insert tab Select the table and select the number of rows and colums

4.Split cell is use to split the data of a cell.Merge cell is used to combine a row or column of cells.

5.Select the cell and click down arrow next to the border button.

5 0
3 years ago
What would provide structured content that would indicate what the code is describing ?
ZanzabumX [31]

Answer:

A.XML

Explanation:

hope this helps

3 0
4 years ago
What does a for loop look for in the sequence of data? Check all that apply.
ValentinkaMS [17]

Answer:

All

Explanation:

Not sure on the context of this question, but a loop is generally used to iterate though every piece of data to perform some kind of operation, on everything in something like an array or string.

7 0
3 years ago
Read 2 more answers
What is created for each user the first time the user logs onto windows?
Naddik [55]
<span>A profile is made the first occasion when that a client sign on to a Windows XP, Windows 2000, or Windows NT® Workstation–based PC. A client profile is a gathering of settings and documents that characterizes the condition that the framework loads when a client sign on. It incorporates all the client arrangement settings, for example, program things, screen hues, organize associations, printer associations, mouse settings, and window size and position. Profiles are not client arrangements and the client has a profile regardless of the possibility that you don't utilize Group Policy.</span>
4 0
3 years ago
A Uniform Resource Locator (URL) consists of three separate parts: network protocol, host, and web browser.
FrozenT [24]
That is false. are you doing it on a computer course.                                             <span />
3 0
3 years ago
Read 2 more answers
Other questions:
  • On January 1, 1980, Moises deposited $1850 into a savings account paying 5.6% interest, compounded quarterly. If he hasn't made
    9·2 answers
  • Consider the following network: proxy-cache On average there are 35 objects downloaded per second, and the average object size i
    14·1 answer
  • How might writing an online journal be different than writing in a paper one ​
    15·2 answers
  • In the processes tab of task manager, the ____ tab displays the âworking setâ of a process, or the amount of memory it is active
    12·1 answer
  • A(n) ______ system is a set of programs that coordinates all the activities among computer or mobile device hardware. a. managem
    10·1 answer
  • Consider the following definition of the recursive function mystery. int mystery(int first, int last) { if (first &gt; last) ret
    12·1 answer
  • Given the following sets, for each set operation provide the elements of the resulting set in set notation or using a well-known
    5·1 answer
  • Calculate the total and average number from 1 to 100<br>​
    12·1 answer
  • How do we “read” and “write” in MAR and MDR memory unit, please help I am very confused :)
    10·1 answer
  • Working mechanism of computer ​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!