answer.
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]
2 years ago
12

Many documents use a specific format for a person's name. Write a program whose input is: firstName middleName lastName and whos

e output is: lastName, firstInitial.middleInitial. Ex: If the input is: Pat Silly Doe the output is: Doe, P.S. If the input has the form: firstName lastName the output is______________.
Computers and Technology
1 answer:
goblinko [34]2 years ago
6 0

Answer:

The solution code is written in Python:

  1. name = input("Enter your name: ")
  2. name_components = name.split(" ")
  3. first_name = name_components[0]
  4. middle_name = name_components[1]
  5. last_name = name_components[2]
  6. print(last_name + ", " + first_name[0] + "." + middle_name[0])

Explanation:

Firstly, prompt user to enter name (Line 1).

Next, use the string <em>split()</em> method and use space " " as separator to split the input string into individual component, first name, middle name, last name and assign to variable <em>first_name, middle_name </em>and<em> last_name </em>(Line 5-7).

Display the output as required by the question.

You might be interested in
Marissa works at a company that makes perfume. She noticed many samples of the perfume were not passing inspection. She conducte
garik1379 [7]
Writing a business letter as if she gets her point across to the head of department then he could change the way they made the perfume so they would pass inspection and standard.
6 0
2 years ago
Read 2 more answers
Mr. Cooper would like to customize his Excel software so his students can create an electronic graph in Excel for their lab repo
Neko [114]
The third one probably
5 0
2 years ago
The java compiler requires that a source file use the ________ filename extension question 3 options: 1) .class 2) .h 3) .java
scoray [572]
<span>3) .java Let's look at the three options and see why they're right or wrong. 1) .class This is the file extension that the java compiler used to the compiled output from the compiler. So it's the wrong answer. 2) .h This is the file extension used for C and C++ header files. So once again, not the right answer. 3) .java This is the correct extension for a java source file to be compiled.</span>
6 0
2 years ago
What is a typical grace period for a credit card...
Schach [20]
It is 20 to 25 days so c is correct
6 0
2 years ago
Read 2 more answers
Write a cout statement that prints the value of a conditional expression. The conditional expression should determine whether th
MissTica

Answer:

The explanation to this question is given below in the explanation section.

Explanation:

#include <iostream>

#include <string>

using namespace std;

int main()

{

   int score;

   cout << "Enter Score: \n";

   cin>>score;

   if (score == 100)

//whether the value of the score variable is equal to 100

   {

       cout << "Perfect ";

//If so, it should print “Perfect”

   }

   else

   {

       cout << "Nice Try ";  

   }

 

}

     

     

7 0
2 years ago
Other questions:
  • how do you make a circuit so 1 switch will turn on/off all the lights(3 lights) and a second switch will change the lights from
    14·2 answers
  • What two methods can be used to access and modify an existing program that is running on an iot device in cisco packet tracer? (
    6·1 answer
  • Match the following technologies with their applications.
    9·1 answer
  • A Class B network needs to be subnetted such that it supports 100 subnets and 100 hosts/ subnet. Which of the following answers
    8·1 answer
  • 1.2.2: Output variable value. Jump to level 1 Write a statement that outputs variable userAge. End with a newline. 1 2 3 4 5 6 7
    12·1 answer
  • Select which type of computer you would like to begin building, based on the needs of your new job: Frequent travel Maintaining
    7·1 answer
  • You are trying to appreciate how important the principle of locality is in justifying the use of a cache memory, so you experime
    11·1 answer
  • In Java please.
    12·1 answer
  • #Write a function called fancy_find. fancy_find should have #two parameters: search_within and search_for. # #fancy_find should
    9·1 answer
  • 1. Used ____________ must be hot drained for 12 hours or crushed before disposal.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!