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
MrRa [10]
2 years ago
12

Write a program named CheckMonth2 that prompts a user to enter a birth month and day. Display an error message that says Invalid

date if the month is invalid (not 1 through 12) or the day is invalid for the month (for example, not between 1 and 31 for January or between 1 and 29 for February). If the month and day are valid, display them with a message. For example, if the month entered is 2, and the day entered is 17, the output should be 2/17 is a valid birthday.
Engineering
1 answer:
bonufazy [111]2 years ago
3 0

Answer:

#Welcome message

print("welcome to CheckMonth2")

#prompting  day and month

day = int(input("Please, add a day: "))

month = int(input("please, add a month: "))

#Defining max number of days per each month

monthly_days = [31,29,31,30,31,30,31,31,30,31,30,31]

#Validating day and month were added properly

if month > 12 or month < 1:

   print("invalid date for the month")

elif day > monthly_days[month-1] or day < 1:

    #Printing error message

   print("invalid date for the month")

else:

   #printing correct message

   print ("{}/{} is a valid birthday".format(day,month))

Explanation:

This code was  made using Python and consists of the following parts:

  • A Welcome message with the name of the code.
  • A line to prompt the day.
  • A line to prompt the month.
  • A list to define the number of day per month. For example, the first posistion of the list corrresponds to the maximum number of days in January, the next is for February and so on.
  • A conditional tests to validate the day and month are in correct. ranges.
  • Output the error message if conditions are not met.
  • Output date if contidios are met.
You might be interested in
A glycerin pump is powered by a 5-kW electric motor. The pressure differential between the outlet and the inlet of the pump at f
Mila [183]

Answer:

Explanation:

Given that:

The pressure differential between the outlet and the inlet of the pump at full load is measured to be ΔP is 211 kPa.

the flow rate through the pump is 18 L/s

The Formula of flow rate.

{Q_f} = \frac{{{P_o}}}{{\Delta P}}

Rearrange

{P_o} = \Delta P\left( {{Q_f}} \right)

Substitute 211{\rm{ kPa}}\, for\, \Delta P \,and\, 18{\rm{ L/s}}\, for\, {Q_f}

\begin{array}{c}\\{P_o} = \left( {211{\rm{ kPa}}} \right)\left( {\left( {18{\rm{ L/s}}} \right)\left( {\frac{{{{10}^{ - 3}}{\rm{ }}{{\rm{m}}^{\rm{3}}}{\rm{/s}}}}{{1\;{\rm{L/s}}}}} \right)} \right)\\\\ = 3.8{\rm{ kW}}\\\end{array}

​The formula for the overall efficiency of the pump.

\eta = \frac{{{P_o}}}{{{{\rm{P}}_{in}}}} \times 100

input the values 3.8kW for {P_o} and 5kW for {P_i}

\begin{array}{c}\\\eta = \left( {\frac{{3.8{\rm{ kW}}}}{{5{\rm{ kW}}}}} \right) \times 100\\\\ = 76\% \\\end{array}

The overall efficiency of the glycerin pump is 76% .

6 0
2 years ago
Question 14<br> Which of these is true of a spray wash cabinet?
weqwewe [10]
What are the options to that question. Insufficient question
5 0
2 years ago
Discuss your interpretation of the confidence-precision trade-off, and provide a few examples of how you might make a choice in
LenKa [72]

The given question is incomplete, the complete question is as follows:

Our text describes a trade-off that we must make as engineers between our confidence in the value of a parameter versus the precision with which we know the value of that parameter. That trade-off might be affected by whether we are looking at a two-sided or bounded (one-sided) interval.

Question: Discuss your interpretation of the confidence-precision trade-off, and provide a few examples of how you might make a choice in one direction or the other in an engineering situation.

Answer: A balancing point is required to be reached to obtain a better confidence level in the predicted values.

Explanation:

The confidence interval and precision are the two terms that aims at providing the accurate estimation of the measurability of an object. If the precision increases, we can compromise on the confidence level and if the confidence level increases, then the precision of the predicted value also dilutes.

Thus a balance point is required to be reached between these two variables so that we get better confidence in the values being predicted without losing the correct estimation on precision. Ensuring that both the confidence and precision are maintained.

8 0
2 years ago
A steam power plant operates on an ideal reheat- regenerative Rankine cycle and has a net power output of 80 MW. Steam enters th
trasher [3.6K]

Answer:

flow(m) = 54.45 kg/s

thermal efficiency u = 44.48%

Explanation:

Given:

- P_1 = P_8 = 10 KPa

- P_2 = P_3 = P_6 = P_7 = 800 KPa

- P_4 = P_5 = 10,000 KPa

- T_5 = 550 C

- T_7 = 500 C

- Power Output P = 80 MW

Find:

-  The mass flow rate of steam through the boiler

-  The thermal efficiency of the cycle.

Solution:

State 1:

P_1 = 10 KPa , saturated liquid

h_1 = 192 KJ/kg

v_1 = 0.00101 m^3 / kg

State 2:

P_2 = 800 KPa , constant volume process work done:

h_2 = h_1 + v_1 * ( P_2 - P_1)

h_2 = 192 + 0.00101*(790) = 192.80 KJ/kg

State 3:

P_3 = 800 KPa , saturated liquid

h_3 = 721 KJ/kg

v_3 = 0.00111 m^3 / kg

State 4:

P_4 = 10,000 KPa , constant volume process work done:

h_4 = h_3 + v_3 * ( P_4 - P_3)

h_4 = 721 + 0.00111*(9200) = 731.21 KJ/kg

State 5:

P_5 = 10,000 KPa , T_5 = 550 C

h_5 = 3500 KJ/kg

s_5 = 6.760 KJ/kgK

State 6:

P_6 = 800 KPa , s_5 = s_6 = 6.760 KJ/kgK

h_6 = 2810 KJ/kg

State 7:

P_7 = 800 KPa , T_7 = 500 C

h_7 = 3480 KJ/kg

s_7 = 7.870 KJ/kgK

State 8:

P_8 = 10 KPa , s_8 = s_7 = 7.870 KJ/kgK

h_8 = 2490 KJ/kg

- Fraction of steam y = flow(m_6 / m_3).

- Use energy balance of steam bleed and cold feed-water:

                                        E_6 + E_2 = E_3

               flow(m_6)*h_6 + flow(m_2)*h_3 = flow(m_3)*h_3

                                    y*h_6 + (1-y)*h_3 = h_3

                                  y*2810 + (1-y)*192.8 = 721

Compute y:                          y = 0.2018

- Heat produced by the boiler q_b:

                             q_b = h_5 - h_4 +(1-y)*(h_7 - h_8)

                    q_b = 3500 -731.21 + ( 1 - 0.2018)*(3480 - 2810)

Compute q_b:               q_b = 3303.58 KJ/ kg

-Heat dissipated by the condenser q_c:

                                       q_c = (1-y)*(h_8 - h_1)

                                 q_c= ( 1 + 0.2018)*(2810 - 192)

Compute q_c:               q_c = 1834.26 KJ/ kg

- Net power output w_net:

                                     w_net = q_b - q_c

                                w_net = 3303.58 - 1834.26

                                    w_net = 1469.32 KJ/kg

- Given out put P = 80,000 KW

                                     flow(m) = P / w_net

compute flow(m)          flow(m) = 80,000 /1469.32 = 54.45 kg/s

- Thermal efficiency u:

                                     u = 1 - (q_c / q_b)

                                     u = 1 - (1834.26/3303.58)

                                     u = 44.48 %

5 0
2 years ago
Consider insulation on a circular pipe For the same thickness and type of insulation, the thermal resistance of the insulation i
leonid [27]

Answer:

b). The same for all pipes independent of the diameter

Explanation:

We know,

R_{conduction}=\frac{ln(\frac{r_{2}}{r_{1}})}{2\pi LK}

R_{convection}=\frac{1}{h(2\pi r_{2}L)}

From the above formulas we can conclude that the thermal resistance of a substance mainly depends upon heat transfer coefficient,whereas radius has negligible effects on heat transfer coefficient.

We also know,

Factors on which thermal resistance of insulation depends are :

1. Thickness of the insulation

2. Thermal conductivity of the insulating material.

Therefore from above observation we can conclude that the thermal resistance of the insulation is same for all pipes independent of diameter.

5 0
2 years ago
Other questions:
  • A square loop of wire surrounds a solenoid. The side of the square is 0.1 m, while the radius of the solenoid is 0.025 m. The sq
    6·1 answer
  • A charge of 2.0 × 10–10 C is to be stored on each plate of a parallel-plate capacitor having an area of 650 mm2 (1.0 in.2 ) and
    14·1 answer
  • At a certain college, 30% of the students major in engineering, 20% play club sports, and 10% both major in engineering and play
    14·1 answer
  • Carbon dioxide gas enters a pipe at 3 MPa and 500 K at a rate of 2 kg/s. CO2 is cooled at constant pressure as it flows in the p
    10·1 answer
  • Water flows downward through a vertical 10-mm-diameter galvanized iron pipe with an average velocity for 5.0 m/s and exits as a
    5·1 answer
  • The components of an electronic system dissipating 90 W are located in a 1-m-long circular horizontal duct of 15-cm diameter. Th
    11·1 answer
  • A commercial refrigerator with refrigerant-134a as the working fluid is used to keep the refrigerated space at -30C by rejecting
    13·1 answer
  • "From the earth to the moon". In Jules Verne’s 1865 story with this title, three men went to the moon in a shell fired from a gi
    5·1 answer
  • Alicia had to get over her fear of heights in order to become comfortable maintaining the generators in wind turbines. professio
    7·1 answer
  • A surface grinding operation is used to finish a flat plate that is 5.50 in wide and 12.500 in long. The starting thickness is 1
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!