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
IrinaVladis [17]
3 years ago
6

The international standard letter/number mapping for telephones is: Write a function that returns a number, given an uppercase l

etter, as follows: def getNumber(uppercaseLetter): Write a test program that prompts the user to enter a phone number as a string. The input number may contain letters. The program translates a letter (uppercase or lowercase) to a digit and leaves all other characters intact. Here is a sample run of the program

Engineering
1 answer:
wolverine [178]3 years ago
5 0

Answer:

Complete Python code along with step by step explanation and output results is provided below.

Python Code with Explanation:

# create a function named getNumber(c)

# Using if elif conditions implement the phonetic character to number conversion for both lower case and upper case letters.

def getNumber(c):

   if(c=='a' or c== 'b' or c=='c' or c=='A' or c == 'B' or c == 'C'):

       return (2)

   elif(c=='d' or c== 'e' or c=='f' or c=='D' or c == 'E' or c == 'F'):

       return (3)

   elif(c=='g' or c== 'h' or c=='i' or c=='G' or c == 'H' or c == 'I'):

       return (4)

   elif(c=='j' or c== 'k' or c=='l' or c=='J' or c == 'K' or c == 'L'):

       return (5)

   elif(c=='m' or c== 'n' or c=='o' or c=='M' or c == 'N' or c == 'O'):

       return (6)

   elif(c=='p' or c== 'q' or c=='r' or c=='s' or c=='P' or c == 'Q' or c == 'R' or c == 'S'):

       return (7)

   elif(c=='t' or c== 'u' or c=='v' or c=='T' or c == 'U' or c == 'V'):

       return (8)

   elif(c=='w' or c== 'x' or c=='y' or c=='z' or c=='W' or c == 'X' or c == 'Y' or c == 'Z'):

       return (9)

   else:

       return (0)

# Get input string from the user

string = input("Please enter any string to convert! ")

# find the length of the input string for the for loop

length = len(string)

# Run a for loop length number of times to call the function getNumber(c) and convert the characters into numbers

for i in range(length):

   c = string[i]

   k = getNumber(c)

   if(k==0):

       print (c,end="")

   else:

       print (k,end="")

# end="" is used so that all numbers displayed in one line

Output:

Please enter any string to convert! Hello WORLD

43556 96753

Please enter any string to convert! Brainly

2724659

You might be interested in
assume a strain gage is bonded to the cylinder wall surface in the direction of the axial strain. The strain gage has nominal re
Anastasy [175]

Explanation:

Note: For equations refer the attached document!

The net upward pressure force per unit height p*D must be balanced by the downward tensile force per unit height 2T, a force that can also be expressed as a stress, σhoop, times area 2t. Equating and solving for σh gives:

 Eq 1

Similarly, the axial stress σaxial can be calculated by dividing the total force on the end of the can, pA=pπ(D/2)2 by the cross sectional area of the wall, πDt, giving:

Eq 2

For a flat sheet in biaxial tension, the strain in a given direction such as the ‘hoop’ tangential direction is given by the following constitutive relation - with Young’s modulus E and Poisson’s ratio ν:

 Eq 3

Finally, solving for unknown pressure as a function of hoop strain:

 Eq 4

Resistance of a conductor of length L, cross-sectional area A, and resistivity ρ is

 Eq 5

Consequently, a small differential change in ΔR/R can be expressed as

 Eq 6

Where ΔL/L is longitudinal strain ε, and ΔA/A is –2νε where ν is the Poisson’s ratio of the resistive material. Substitution and factoring out ε from the right hand side leaves

 Eq 7

Where Δρ/ρε can be considered nearly constant, and thus the parenthetical term effectively becomes a single constant, the gage factor, GF

 Eq 8

For Wheat stone bridge:

 Eq 9

Given that R1=R3=R4=Ro, and R2 (the strain gage) = Ro + ΔR, substituting into equation above:

Eq9

Substituting e with respective stress-strain relation

Eq 10

Download docx
7 0
3 years ago
Please help
Alla [95]

Answer:

Explanation:

?

5 0
3 years ago
In the idealized Otto cycle, heat is added during: a. Isentropic Compression b. Constant (minimum) volume c. Constant (maximum)
docker41 [41]

Answer:

(b) Constant (minimum) volume

Explanation:

In the idealized Otto cycle there are 4 process that are

  • Reversible adiabatic compression  
  • Addition of heat at constant volume
  • Reversible adiabatic expansion
  • Rejection of constant volume

So from above discussion we can see that heat is added when there is constant (minimum) volume which is given in option (b) so option (b) will be the correct answer

3 0
3 years ago
The polycarbonate shell functions as all of the following except:
krok68 [10]

Answer:

what are the answers expect what?

Explanation:

Polycarbonate is commonly used in eye protection, as well as in other projectile-resistant viewing and lighting applications that would normally indicate the use of glass, but require much higher impact-resistance. Polycarbonate lenses also protect the eye from UV light.

6 0
3 years ago
(a) Show how two 2-to-1 multiplexers (with no added gates) could be connected to form a 3-to-1 MUX. Input selection should be as
Llana [10]

Answer:

Explanation:

a) Show how two 2-to-1 multiplexers (with no added gates) could be connected to form a 3-to-1 MUX. Input selection should be as follows: If AB = 00, select I0 If AB = 01, select I1 If AB = 1− (B is a don’t-care), select I2

We are to show how Two-2-to -1 multiplexers could be connected to form 3-to-1 MUX

If AB = 00 select I_o

If AB = 01 select I_1

If AB = 1_(B is don't care), select I_2

However, the truth table is attached and shown in the first file below.

Also, the free- body diagram for 2- to - 1 MUX is shown in the second diagram attached below.

b) We are show how  two 4-to-1 and one 2-to-1 multiplexers could be connected to form an 8-to-1 MUX with three control inputs.

The perfect illustration showing how they are connected in displayed in the third free-body diagram attached below.

Where ; I_o , I_1, I_2, I_3, I_4, I_5, I_6, I_7 are the inputs of the multiplexer and Z is the output.

c)  Show how four 2-to-1 and one 4-to-1 multiplexers could be connected to form an 8-to-1 MUX with three control inputs.

For  four 2-to-1 and one 4-to-1 multiplexers could be connected to form an 8-to-1 MUX with three control inputs, we have a perfect illustration of the diagram in the last( which is the fourth) diagram attached below.

Where ; I_o , I_1, I_2, I_3, I_4, I_5, I_6, I_7 are the inputs of the multiplexer and Z is the output

5 0
4 years ago
Other questions:
  • It is easy to say that an organization should hire, reward, and dismiss employees based on their character as well as their know
    11·1 answer
  • Can you tell me important facts about Peggy A. Whitson?
    5·1 answer
  • To measure the voltage drop across a resistor, a _______________ must be placed in _______________ with the resistor. Ammeter; S
    9·1 answer
  • A police officer in a patrol car parked in a 70 km/h speed zone observes a passing automobile traveling at a slow, constant spee
    6·1 answer
  • Explain the process of predicting equipment failure?
    12·1 answer
  • What are significant figures​
    13·1 answer
  • Which of the following should you avoid when pulling over to the curb?
    8·2 answers
  • Which of the following explains the main reason to cut a piece of wood on the outside of the measurement mark?
    13·1 answer
  • How do I do this?<br> Blueprints, complete the missing view.
    15·1 answer
  • (D)<br> 13. Describe the differences between an impact socket and a conventional socket.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!