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
Nikolay [14]
3 years ago
6

Write multiple if statements: If carYear is before 1967, print "Probably has few safety features." (without quotes). If after 19

70, print "Probably has head rests.". If after 1991, print "Probably has electronic stability control.". If after 2002, print "Probably has airbags.". End each phrase with period and newline. Ex: carYear = 1995 prints:
Engineering
1 answer:
Free_Kalibri [48]3 years ago
5 0

Answer:

The solution code is written in Python 3.

  1. carYear = 1995
  2. if(carYear < 1967):
  3.    print("Probably has few safety features.\n")
  4. if(carYear > 1970):
  5.    print("Probably has head rests. \n")
  6. if(carYear > 1991):
  7.    print("Probably has electronic stability control.\n")
  8. if(carYear > 2002):
  9.    print("Probably has airbags. \n")

Explanation:

Firstly, create a variable, <em>carYear</em> to hold the value of year of the car make. (Line 1)

Next, create multiple if statements as required by the question (Line 3-13). The operator "<" denotes "smaller" and therefore <em>carYear < 1967</em> means any year before 1967. On another hand, the operator ">" denotes "bigger" and therefore <em>carYear > 1970 </em>means any year after 1970.

The print statement in each of the if statements is done using the Python built-in function <em>print()</em>. The "\n" is an escape sequence that create a new line at the end of each printed phrase.

You might be interested in
The function below takes a single parameter, a list of numbers called number_list. Complete the function to return a string of t
makkiz [27]

Answer:

The solution code is written in Python:

  1. def convertCSV(number_list):
  2.    str_list = []
  3.    for num in number_list:
  4.        str_list.append(str(num))
  5.    
  6.    return ",".join(str_list)
  7. result = convertCSV([22,33,44])
  8. print(result)

Explanation:

Firstly, create a function "convertCSV" with one parameter "number_list". (Line 1)

Next, create an empty list and assign it to a new variable <em>str_list</em>. (Line 2)

Use for-loop to iterate through all the number in the <em>number_list</em>.(Line 4). Within the loop, each number is converted to a string using the Python built-in function <em>str() </em>and then use the list append method to add the string version of the number to <em>str_list</em>.

Use Python string<em> join() </em>method to join all the elements in the str_list as a single string. The "," is used as a separator between the elements (Line 7) . At the end return the string as an output.

We can test the function by calling the function and passing [22,33,34] as an argument and we shall see "22,33,44" is printed as an output. (Line 9 - 10)

6 0
3 years ago
thermodynamics A nuclear power plant based on the Rankine cycle operates with a boiling-water reactor to develop net cycle power
IrinaK [193]

Answer:

(a) the percent thermal efficiency is 27.94%

(b) the temperature of the cooling water exiting the condenser is 31.118°C

Explanation:

3 0
3 years ago
Urgent please help me...
Pepsi [2]
Scuze , am incercat , dat chiar nu stiu. Prefer sa nu raspund si sa scriu asta decat sa raspund gresit.❤️
7 0
3 years ago
Gas is kept in a 0.1 m diameter cylinder under the weight of a 100 kg piston that is held down by a spring with a stiffness k =
Artyom0805 [142]

Answer:

The spring is compressed by 0.275 meters.

Explanation:

For equilibrium of the gas and the piston the pressure exerted by the gas on the piston should be equal to the sum of  weight of the piston and the force the spring exerts on the piston

Mathematically we can write

Force_{pressure}=Force_{spring}+Weight_{piston}

we know that

Force_{pressure}=Pressure\times Area=300\times 10^{3}\times \frac{\pi \times 0.1^2}{4}=750\pi Newtons

Weight_{piston}=mass\times g=100\times 9.81=981Newtons

Now the force exerted by an spring compressed by a distance 'x' is given by Force_{spring}=k\cdot x=5\times 10^{3}\times x

Using the above quatities in the above relation we get

5\times 10^{3}\times x+981=750\pi \\\\\therefore x=\frac{750\pi -981}{5\times 10^{3}}=0.275meters

5 0
3 years ago
If the bending moment (M) is 4,176 ft-lb and the beam is an 1 beam, calculate the bending stress (psi) developed at a point with
SpyIntel [72]

Answer:

Bending stress at point 3.96 is \sigma_b = 1.37 psi

Explanation:

Given data:

Bending Moment M is 4.176 ft-lb = 50.12 in- lb

moment of inertia I = 144 inc^4

y = 3.96 in

\sigma_b = \frac{M}{I} \times y

putting all value to get bending stress

\sigma_b = \frac{50.112}{144} \times 3.96  

\sigma_b =  1.37 psi

Bending stress at point 3.96 is \sigma_b = 1.37 psi

3 0
4 years ago
Other questions:
  • Researchers compared protein intake among three groups of postmenopausal women: (1) women eating a standard American diet (STD),
    14·1 answer
  • What is a shearing stress? Is there a force resulting from two solids in contact to which is it similar?
    6·1 answer
  • The spring has a stiffness k = 200 N&gt;m and an unstretched length of 0.5 m. If it is attached to the 3-kg smooth collar and th
    12·1 answer
  • 3. How can statistical analysis of a dataset inform a design process?<br> PLEASE I NEED THIS ANSWER
    8·1 answer
  • What time ----–- the train arrve? ​​
    12·1 answer
  • The three suspender bars AB, CD, and EF are made of A-36 steel and have equal cross-sectional areas of 500 mm2. Determine the av
    9·1 answer
  • An add tape of 101 ft is incorrectly recorded as 100 ft for a 200-ft distance. What is
    6·1 answer
  • g Clay sized particles in a river are likely to be transported as _______________________, whereas gravel sized particles are li
    5·1 answer
  • Kaya just bought a house and realizes that the chimney needs to be totally torn down and rebuilt. She needs to call an expert si
    6·1 answer
  • A 20cm-long rod with a diameter of 0.250 cm is loaded with a 5000 N weight. If the diameter of the bar is 0.490 at this load, de
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!