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
labwork [276]
4 years ago
12

9.17 LAB: Name format Many documents use a specific format for a person's name. Write a program whose input is: firstName middle

Name lastName, and whose output is: lastName, firstName middleInitial. Ex: If the input is: Pat Silly Doe the output is: Doe, Pat S. If the input has the form firstName lastName, the output is lastName, firstName. Ex: If the input is: Julia Clark the output is: Clark, Julia
Engineering
2 answers:
snow_lady [41]4 years ago
7 0

Answer:

name=input("Enter a name: ")

names = name.split()

if

(len(names)==3): middle=names[1] mid=middle[0].upper()+"." last=names[2]+"," first=names[0] print('Formatted Name:',last,first,mid) elif(len(names)==2): last=names[1]+',' first=names[0]

print('Formatted Name:',last,first)

else:

print('The input does not have the correct form')

nexus9112 [7]4 years ago
7 0

Answer:

A better answer is:

#get input and assign to variable

name = input()

#split input in  new variable

split_name = name.split()

#split first name

firstName = split_name[0]

#split middle name

middleName = split_name[1]

#check how many 'names' in list

if len(split_name) == 2:

#last name, first initial

   print(middleName + ',', firstName[0:1] + '.')

# check how many 'names' in list again

if len(split_name) == 3:

#assign last name

   lastName = split_name[2]

#print last name, firstinitial.middleinitial

   print(lastName + ',', firstName[0:1] + '.' + middleName[0:1] + '.')

Explanation:

You might be interested in
Under EPA's regulations, which of the following methods can be used to pressurize an R11 or R123 system for the purpose of openi
Natasha2012 [34]

Answer:

(A) Adding Nitrogen

Explanation:

R11 or R123 are flammable substance under certain conditions when mixed with Oxygen, adding Nitrogen is a safety procedure used in displacing any R11 or R123 which are considered as hazardous when mixed with Oxygen.

7 0
3 years ago
What is bubble sort?what is bubble sort ​
juin [17]

Answer:

Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted.

Explanation:

Look at the photo

Good luck

4 0
3 years ago
Read 2 more answers
Schrodinger equation is a ........... Equation
Tanzania [10]

Answer:

linear partial differential

Explanation:

The Schrödinger equation is a linear partial differential equation that describes the wave function or state function of a quantum-mechanical system. It is a key result in quantum mechanics, and its discovery was a significant landmark in the development of the subject.

5 0
3 years ago
C programming fundamentals for everyone​
densk [106]

Answer:I am so sorry but here are no questions, thanks for the points

Explanation:Have a nice day

6 0
3 years ago
Refrigerant-134a enters an adiabatic compressor as saturated vapor at -24°C and leaves at 0.8 MPa and 60°C. The mass flow rate o
Leni [432]

Answer:

(a) The power input to the compressor: \dot{W}=73.07 kJ/s = 73.07 kW

(b) The volume flow rate of the refrigerant at the compressor inlet: \dot{v}=0.209 m^{3}/s

Explanation:

(a)

We need to check the values of enthalpy (as we have an open system) for both states, being the inlet, state 1 and the outlet, state 2. We will know these values by checking the vapor charts of R134a, I used the ones found in Thermodynamics of Cengel, 7th edition.

Then, our values are:

h_{1}=235.92kJ/kg\\h_{2}=296.81kJkg

Now we proceed to know the work with the following expression:

\dot{W}=\dot{m}(h_{2}-h_{1})

Now we replace values and our result is:

\dot{W}=73.07 kJ/s = 73.07 kW

(b)

To know the volume rate at the compressor inlet, we need to know the specific volume in that phase, as we have that is saturated and at -24°C, we can read our table:

\nu=0.1739m^{3}/kg

With our specific volume and the mass rate, we can calculate the volume rate:

\dot{v}=\nu * \dot{m}\\\dot{v}=0.209 m^{3}/s

6 0
3 years ago
Other questions:
  • A mass of air occupying a volume of 0.15m^3 at 3.5 bar and 150 °C is allowed [13] to expand isentropically to 1.05 bar. Its enth
    11·1 answer
  • Think about all the things we have investigated in class so far this semester. Identify three examples of climate-related aspect
    7·1 answer
  • A 30-tooth gear has AGMA standard full-depth involute teeth with diametral pitch of 12. Calculate the pitch diameter, circular p
    12·1 answer
  • A pictoral logo is a ________________ and it's identifying the ___________ of the company.
    5·1 answer
  • The hoist supports the 125-kg engine. Determine the force the load creates in member DB and in member FB, which contains the hyd
    11·1 answer
  • HELP ASSAPPP
    15·1 answer
  • :) 1. Outline two differences between a moving coil -coil and a moving-iron instrument.​
    12·1 answer
  • According to the video, what qualities do Traffic Technicians need? Check all that apply.
    14·1 answer
  • A motor car shaft consists of a steel tube 30 mm internal diameter and 4 mm thick. The engine develops 10 kW at 2000 r.p.m. Find
    11·1 answer
  • What are the horizontal structures beneath a slab that help transfer the load from the slab to the columns?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!