132k views
2 votes
Many documents use a write a program that takes a date as input and outputs the date's season. The input is a string to represent the month and an int to represent the day. For example, if the input is: April 11, the output is: Spring. Write a program that reads a person's name in the following format: firstname middlename lastname (in one line) and outputs the person's name in the following format: lastname, firstinitial.middleinitial.

User Legale
by
8.1k points

1 Answer

2 votes

Final answer:

The question asks for a program that reformats a person's name, which is a high school-level Computers and Technology problem. The program should read a full name and output it in a 'lastname, firstinitial.middleinitial' format.

Step-by-step explanation:

The question involves writing a computer program to handle the input of a person's name in one format and output it in another specified format. This falls under the category of Computers and Technology and could be an assignment at the High School level, particularly in a computer science or programming class. To complete this task, one would need to write a code snippet that reads a full name, splits it into the respective parts, and then rearranges and formats these parts according to the requirements. Here's a simple outline of the steps involved:

  • Take input of the person's complete name in 'firstname middlename lastname' format.
  • Split the input into three separate strings for the first, middle, and last names.
  • Extract the initial of the first and middle names.
  • Construct the final string in 'lastname, firstinitial.middleinitial' format.
  • Output the final formatted name.

Note that this is a high-level description and the actual implementation would depend on the programming language being used. The task helps students understand string manipulation and formatting-a key skill in programming.

User Todd Davis
by
8.6k points