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
What provision of the Government Paperwork Elimination Act was designed to encourage a paperless society?
Ratling [72]
<span>Validation of electronic signatures was designed to encourage a paperless society.</span>
8 0
3 years ago
Read 2 more answers
What is 4991 rounded to the nearest thousand
evablogger [386]

Answer:

5000

Explanation:

5 0
3 years ago
Read 2 more answers
Cerinţa
Firdavs [7]
Uummmm English please
4 0
3 years ago
Suppose that a minus sign in the input indicates pop the stack and write the return value to standard output, and any other stri
Sergio [31]
It’s b just really got to make since an read it right that’s all
7 0
3 years ago
Read 2 more answers
Which of the following is NOT a feature of unclustered index
Lorico [155]

Answer:

C. Unclustered index has the same ordering of data records as that of the data entries in the database

Explanation:

Indexes are used to split up queries in an SQL server or database management system DBMS.

There are two types of indexes namely clustered indexed and unclustered indexes.

Clustered indexes define the order in which data is stored in a table while unclustered index does not sort the order in a table.

In an unclustered index, the data table and the index are stored in different places, they are easy to maintain and update since they do not follow a particular order and there can be several indexes in a data file since the data table is stored differently from the index file.

So, all the other options except C are features of unclustered indexes since  unclustered index does not have the same ordering of data records as that of the data entries in the database.

So, C is the answer.

3 0
3 years ago
Other questions:
  • A paradigm innovation occurs when:
    6·1 answer
  • "A ____ is a collection of hardware and other devices that are connected together so that users can share hardware, software, an
    5·1 answer
  • The function of the file server is to : 1. store data and software programs that can be used by client computers on the network.
    12·1 answer
  • To move the first line of text over five spaces and leave the other lines of the paragraph aligned to the left, use the _____ fe
    12·2 answers
  • The following statement calls a function named half, which returns a value that is half
    8·1 answer
  • # 12/9/2020
    13·1 answer
  • Digital communication and production chapter 17
    6·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    7·1 answer
  • Question #1
    13·2 answers
  • Select the correct answer.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!