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]
1 year 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]1 year 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
If the result is for a BART Transit Station: "Daly City Station" with the result address "Daly City,CA". What is the correct rat
Sholpan [36]

Answer:

c. Incorrect street number and correct street name

Explanation:

Bay Area Rapid Transit (BART) is a transportation system that runs along San Francisco in California. The transport system knows the streets of California because it runs on it.

The system keep on improving with time and following the trends of other transport systems in the the world, Like using the Debt cards and credit card to charge for their fares. More than 433,000 people use the transportation system in California.

From the question, The resulting address is accurate while entering ‘Dala city Station’, to the BART Transit Station, the address comes as Dala City CA 94014.

3 0
2 years ago
Write a program that prints the U.S. presidential election years from 1792 to present day, knowing that such elections occur eve
miv72 [106K]

Answer:

The cpp program to print US presidential years is given.

#include <iostream>

using namespace std;

int main()

{

   // variable to hold presidential election year declared  

   int elec_year;

// variable to hold presidential election year initialized to 1792  

elec_year=1792;

   

// the value displayed on the console output

   std::cout << "The U.S. presidential election years from 1792 to present day are listed. " << std::endl;

   

   // loop executes till year is less than or equals 2020

   do

   {

       // initial value is printed

       std::cout << elec_year << std::endl;

       

       // value is incremented by 4

       elec_year = elec_year + 4;

       

   }while(elec_year<=2020);

   return 0;

}

OUTPUT

The U.S. presidential election years from 1792 to present day are listed.  

1792

1796

1800

1804

1808

1812

1816

1820

1824

1828

1832

1836

1840

1844

1848

1852

1856

1860

1864

1868

1872

1876

1880

1884

1888

1892

1896

1900

1904

1908

1912

1916

1920

1924

1928

1932

1936

1940

1944

1948

1952

1956

1960

1964

1968

1972

1976

1980

1984

1988

1992

1996

2000

2004

2008

2012

2016

2020

Explanation:

The program works as described.

1. An integer variable, elec_year, is declared and initialized with the first US presidential year value, 1792.

2. Inside the do-while loop, the variable, elec_year, is first printed to the console followed by a new line inserted using, endl.

3. The variable, elec_year, is then incremented by 4.

4. The do-while loop continues till the value of the variable, elec_year, does not exceeds the current year, 2020.

5. The program ends with a return statement since main() has return type int.

6. Only one variable is used in the program.

7. The program consists of only main() method since cpp is not completely object oriented programming language.

8. The same program, if written in object oriented programming language like java or c# will be written inside a class and executed through main() method.

4 0
1 year ago
Which statement best describes how the rapid prototyping model works?a) Developers create prototypes to show stakeholders how va
VashaNatasha [74]
Developers are aiming for two goals from their products. 
one is the amount of money they can make off of their production of inventions. 
and two is the effenciency of the produce. 

i would strongly have to go with a 
though im not very fond of computers and technology classes

6 0
2 years ago
Read 2 more answers
The results of the spec cpu2006 bzip2 benchmark running on an amd barcelona has an instruction count of 2.389e12, an execution t
saw5 [17]

Answer:

CPI = 0.94

Explanation:

The formula for execution time is given below:

Execution time = clock cycles * cycle time

As Execution time = 750 s

clock cycle time = 0.333 ns = 0.333 * 10^-9

so putting these values in the above formula, we get

750 = clock cycles * ( 0.333 * 10^-9 )

clock cycles = 750 / ( 0.333 * 10^-9 )

clock cycles = 2.25 * 10^12

As the results of the spec cpu2006 bzip2 benchmark running on an amd barcelona has an instruction count = 2.389 * 10^12

and the formula for clock cycles is:

clock cycles = number of instructions * CPI

CPI = clock cycles / number of instructions

CPI = 2.25 * 10^12 / 2.389 * 10^12

CPI = 0.94

5 0
2 years ago
In which of the following situations may you pass on the right
Natasha2012 [34]
In driving your vehicle, it is best to pass on the right after you slow your vehicle down and check for the road whether there is an upcoming vehicle or not. When the road is clear, it is best and safe to pass on the right after making sure that the coast is clear.
3 0
1 year ago
Read 2 more answers
Other questions:
  • Brianna would like to use a small program within the database to simplify the complicated task of creating a report. She should
    13·1 answer
  • python Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value i
    7·1 answer
  • The ______ is the information center that drivers need to refer to when they're NOT scanning the road.
    7·1 answer
  • Which one of the following is the best example of an authorization control? (a)- Biometric device (b)- Digital certificate (c)-A
    11·1 answer
  • In your own words, what is pair-programming? What is the role of the driver? What is the role of the navigator? What are some be
    15·1 answer
  • Why is the following statement true - ideally, your information is abbreviated
    10·2 answers
  • Our new catalog contains an eclectic collection of items
    6·1 answer
  • 7.8.1: Function pass by reference: Transforming coordinates. Define a function CoordTransform() that transforms the function's f
    6·1 answer
  • int decode2(int x, int y, int z); is compiled into 32bit x86 assembly code. The body of the code is as follows: NOTE: x at %ebp+
    5·1 answer
  • Exercise 4: Bring in program grades.cpp and grades.txt from the Lab 10 folder. Fill in the code in bold so that the data is prop
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!