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
rodikova [14]
2 years ago
15

NEEDS TO BE IN PYTHON:ISBN-13 is a new standard for indentifying books. It uses 13 digits d1d2d3d4d5d6d7d8d910d11d12d13 . The la

st digit d13 is a checksum, which is calculated from the other digits using the following formula:10 - (d1 + 3*d2 + d3 + 3*d4 + d5 + 3*d6 + d7 + 3*d8 + d9 + 3*d10 + d11 + 3*d12) % 10If the checksum is 10, replace it with 0. Your program should read the input as a string. Display "incorrect input" if the input is incorrect.Sample Run 1Enter the first 12 digits of an ISBN-13 as a string: 978013213080The ISBN-13 number is 9780132130806Sample Run 2Enter the first 12 digits of an ISBN-13 as a string: 978013213079The ISBN-13 number is 9780132130790

Engineering
1 answer:
kondor19780726 [428]2 years ago
4 0

Answer:

Follows are the code to this question:

n=input("Enter the first 12 digits of an ISBN-13 as a string:")#defining a varaible isbn for input value

if len(n)!=12: #use if block to check input value is equal to 12 digits

   print("incorrect input") #print error message

elif n.isdigit()==False: #use else if that check input is equal to digit

   print("incorrect input") #print error message

else:# defining else block

   s=0 #defining integer vaiable s to 0

   for i in range(12):#defining for loop to calculate sum of digit

       if i%2==0: #defining if block to check even value

           s=s+int(n[i])#add even numbers in s vaiable  

       else: #use else block for odd numbers

           s=s+int(n[i])*3 #multiply the digit with 3 and add into s vaiable

   s=s%10#calculate the remainder value  

   s=10-s#subtract the remainder value with 10 and hold its value

   if s==10: #use if to check s variable value equal to 10  

       s=0#use s variable to assign the value 0

   n=n+s.__str__() #u

Output:

please find attached file.

Explanation:In the above Python code, the "n" variable is used for input the number into the string format uses multiple conditional statements for a check input value, which can be defined as follows:

  • In if block, it checks the length isn't equal to 12, if the condition true, it will print an error message.
  • In the else, if the block it checks input value does not digit, if the condition is true, it will print an error message.
  • In the else block, it uses the for loop, in which it calculates the even and odd number sum, and in the odd number, we multiply by 3 then add into s variable.
  • In this, the s variable is used to calculate its remainder and subtract from the value and use the if block to check, its value is not equal to 10 if it's true, it adds 0 into the last of n variable, otherwise, it adds its calculated value.    

You might be interested in
) A shaft encoder is to be used with a 50 mm radius tracking wheel to monitor linear displacement. If the encoder produces 256 p
andrey2020 [161]

Answer:

number of pulses produced =  162 pulses

Explanation:

give data

radius = 50 mm

encoder produces = 256 pulses per revolution

linear displacement = 200 mm

solution

first we consider here roll shaft encoder on the flat surface without any slipping

we get here now circumference that is

circumference = 2 π r .........1

circumference = 2 × π × 50

circumference = 314.16 mm

so now we get number of pulses produced

number of pulses produced = \frac{linear\ displacement}{circumference} × No of pulses per revolution .................2

number of pulses produced = \frac{200}{314.16} × 256

number of pulses produced =  162 pulses

5 0
2 years ago
Determine the angular acceleration of the uniform disk if (a) the rotational inertia of the disk is ignored and (b) the inertia
lukranit [14]

Answer:

α = 7.848 rad/s^2  ... Without disk inertia

α = 6.278 rad/s^2  .... With disk inertia

Explanation:

Given:-

- The mass of the disk, M = 5 kg

- The right hanging mass, mb = 4 kg

- The left hanging mass, ma = 6 kg

- The radius of the disk, r = 0.25 m

Find:-

Determine the angular acceleration of the uniform disk without and with considering the inertia of disk

Solution:-

- Assuming the inertia of the disk is negligible. The two masses ( A & B )  are hung over the disk in a pulley system. The disk is supported by a fixed support with hinge at the center of the disk.

- We will make a Free body diagram for each end of the rope/string ties to the masses A and B.

- The tension in the left and right string is considered to be ( T ).

- Apply newton's second law of motion for mass A and mass B.

                      ma*g - T = ma*a

                      T - mb*g = mb*a

Where,

* The tangential linear acceleration ( a ) with which the system of two masses assumed to be particles move with combined constant acceleration.

- g: The gravitational acceleration constant = 9.81 m/s^2

- Sum the two equations for both masses A and B:

                      g* ( ma - mb ) = ( ma + mb )*a

                      a =  g* ( ma - mb ) / ( ma + mb )

                      a = 9.81* ( 6 - 4 ) / ( 6 + 4 ) = 9.81 * ( 2 / 10 )

                      a = 1.962 m/s^2  

- The rope/string moves with linear acceleration of ( a ) which rotates the disk counter-clockwise in the direction of massive object A.

- The linear acceleration always acts tangent to the disk at a distance radius ( r ).

- For no slip conditions, the linear acceleration can be equated to tangential acceleration ( at ). The correlation between linear-rotational kinematics is given below :

                     a = at = 1.962 m/s^2

                     at = r*α      

Where,

           α: The angular acceleration of the object ( disk )

                    α = at / r

                    α = 1.962 / 0.25

                    α = 7.848 rad/s^2                                

- Take moments about the pivot O of the disk. Apply rotational dynamics conditions:

             

                Sum of moments ∑M = Iα

                 ( Ta - Tb )*r = Iα

- The moment about the pivots are due to masses A and B.

 

               Ta: The force in string due to mass A

               Tb: The force in string due to mass B

                I: The moment of inertia of disk = 0.5*M*r^2

                   ( ma*a - mb*a )*r = 0.5*M*r^2*α

                   α = ( ma*a - mb*a ) / ( 0.5*M*r )

                   α = ( 6*1.962 - 4*1.962 ) / ( 0.5*5*0.25 )

                   α = ( 3.924 ) / ( 0.625 )

                   α = 6.278 rad/s^2

6 0
2 years ago
A three-phase line has an impedance of 0.4 j2.7 ohms per phase. The line feeds two balanced three-phase loads that are connected
Viktor [21]

Answer:

a. The magnitude of the line source voltage is

Vs = 4160 V

b. Total real and reactive power loss in the line is

Ploss = 12 kW

Qloss = j81 kvar

Sloss = 12 + j81 kVA

c. Real power and reactive power supplied at the sending end of the line

Ss = 540.046 + j476.95 kVA

Ps = 540.046 kW

Qs = j476.95 kvar

Explanation:

a. The magnitude of the line voltage at the source end of the line.

The voltage at the source end of the line is given by

Vs = Vload + (Total current×Zline)

Complex power of first load:

S₁ = 560.1 < cos⁻¹(0.707)

S₁ = 560.1 < 45° kVA

Complex power of second load:

S₂ = P₂×1 (unity power factor)

S₂ = 132×1

S₂ = 132 kVA

S₂ = 132 < cos⁻¹(1)

S₂ = 132 < 0° kVA

Total Complex power of load is

S = S₁ + S₂

S = 560.1 < 45° + 132 < 0°

S = 660 < 36.87° kVA

Total current is

I = S*/(3×Vload)   ( * represents conjugate)

The phase voltage of load is

Vload = 3810.5/√3

Vload = 2200 V

I = 660 < -36.87°/(3×2200)

I = 100 < -36.87° A

The phase source voltage is

Vs = Vload + (Total current×Zline)

Vs = 2200 + (100 < -36.87°)×(0.4 + j2.7)

Vs = 2401.7 < 4.58° V

The magnitude of the line source voltage is

Vs = 2401.7×√3

Vs = 4160 V

b. Total real and reactive power loss in the line.

The 3-phase real power loss is given by

Ploss = 3×R×I²

Where R is the resistance of the line.

Ploss = 3×0.4×100²

Ploss = 12000 W

Ploss = 12 kW

The 3-phase reactive power loss is given by

Qloss = 3×X×I²

Where X is the reactance of the line.

Qloss = 3×j2.7×100²

Qloss = j81000 var

Qloss = j81 kvar

Sloss = Ploss + Qloss

Sloss = 12 + j81 kVA

c. Real power and reactive power supplied at the sending end of the line

The complex power at sending end of the line is

Ss = 3×Vs×I*

Ss = 3×(2401.7 < 4.58)×(100 < 36.87°)

Ss = 540.046 + j476.95 kVA

So the sending end real power is

Ps = 540.046 kW

So the sending end reactive power is

Qs = j476.95 kvar

7 0
2 years ago
Who want to play "1v1 lol unblocked games 76"
kotegsom [21]

Answer:I want to play what game?

Explanation:

3 0
2 years ago
Read 2 more answers
A 10-m long steel linkage is to be designed so that it can transmit 2 kN of force without stretching more than 5 mm nor having a
Fed [463]

Answer:

<em>minimum required diameter of the steel linkage is 3.57 mm</em>

<em></em>

Explanation:

original length of linkage l = 10 m

force to be transmitted  f = 2 kN = 2000 N

extension e = 5 mm= 0.005 m

maximum stress σ = 200 N/mm^2 = 2*10^{8}  N/m^{2}

maximum stress allowed on material σ = force/area

imputing values,

200 = 2000/area

area = 2000/(2*10^{8}) = 10^{-5} m^2

recall that area = \pi d^{2} /4

10^{-5} = \frac{3.142*d^{2} }{4} = 0.7855d^{2}

d^{2} = \frac{10^{-5} }{0.7855} = 1.273*10^{-5}

d = \sqrt{1.273*10^{-5}  } = 3.57*10^{-3} m = 3.57 mm

<em>maximum diameter of  the steel linkage d = 3.57 mm</em>

4 0
2 years ago
Other questions:
  • A petrol engine produces 20 hp using 35 kW of heat transfer from burning fuel. What is its thermal efficiency, and how much powe
    14·1 answer
  • Consider a plane composite wall that is composed of two materials of thermal conductivities kA 0.1 W/mK and kB 0.04 W/mK and thi
    14·1 answer
  • A binary star system consists of two stars of masses m1m1m_1 and m2m2m_2. The stars, which gravitationally attract each other, r
    9·1 answer
  • Two physical properties that have a major influence on the cracking of workpieces, tools, or dies during thermal cycling are the
    13·1 answer
  • In this module you learned about searching, sorting and algorithms in C++ and how to implement these elements in your C++ progra
    6·1 answer
  • A soil element is subjected to a minor principle stress of 50 kPa on a plane rotated 20 ° counterclockwise from vertical. If the
    10·1 answer
  • What is the component called that usually has a dual-voltage selector switch and has cables that connect to the motherboard and
    15·1 answer
  • When encountering low visibility from rain or fog, you should use your ____.
    12·1 answer
  • What are practical considerations you might encounter when you increase the moment of inertia (I) while keeping the cross-sectio
    13·1 answer
  • 140-character statement that completes this sentence: I pledge to not text and drive because...
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!