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
Alona [7]
2 years ago
13

12.28 LAB: Output values in a list below a user defined amount - functions Write a program that first gets a list of integers fr

om input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, and output all integers less than or equal to that value. Ex: If the input is: 5 50 60 140 200 75 100 the output is: 50 60 75 The 5 indicates that there are five integers in the list, namely 50, 60, 140, 200, and 75. The 100 indicates that the program should output all integers less than or equal to 100, so the program outputs 50, 60, and 75.
Engineering
1 answer:
Anastaziya [24]2 years ago
8 0

Answer:

def output_ints_less_than_or_equal_to_threshold(user_values, upper_threshold):

   for value in user_values:

       if value < upper_threshold:

           print(value)  

def get_user_values():

   n = int(input())

   lst = []

   for i in range(n):

       lst.append(int(input()))

   return lst  

if __name__ == '__main__':

   userValues = get_user_values()

   upperThreshold = int(input())

   output_ints_less_than_or_equal_to_threshold(userValues, upperThreshold)

You might be interested in
In a heat-treating process, a 1-kg metal part, initially at 1075 K, is quenched in a closed tank containing 100 kg of water, ini
storchak [24]

Answer:

attached below

Explanation:

8 0
2 years ago
A thermal energy storage unit consists of a large rectangular channel, which is well insulated on its outer surface and encloses
yaroslaw [1]

Answer:

the temperature of the aluminum at this time is 456.25° C

Explanation:

Given that:

width w of the aluminium slab = 0.05 m

the initial temperature T_1 = 25° C

T{\infty} =600^0C

h = 100 W/m²

The properties of Aluminium at temperature of 600° C by considering the conditions for which the storage unit is charged; we have ;

density ρ = 2702 kg/m³

thermal conductivity k = 231 W/m.K

Specific heat c = 1033 J/Kg.K

Let's first find the Biot Number Bi which can be expressed by the equation:

Bi = \dfrac{hL_c}{k} \\ \\ Bi = \dfrac{h \dfrac{w}{2}}{k}

Bi = \dfrac{hL_c}{k} \\ \\ Bi = \dfrac{100 \times \dfrac{0.05}{2}}{231}

Bi = \dfrac{2.5}{231}

Bi = 0.0108

The time constant value \tau_t is :

\tau_t = \dfrac{pL_cc}{h} \\ \\ \tau_t = \dfrac{p \dfrac{w}{2}c}{h}

\tau_t = \dfrac{2702* \dfrac{0.05}{2}*1033}{100}

\tau_t = \dfrac{2702* 0.025*1033}{100}

\tau_t = 697.79

Considering Lumped capacitance analysis since value for Bi is less than 1

Then;

Q= (pVc)\theta_1 [1-e^{\dfrac {-t}{ \tau_1}}]

where;

Q = -\Delta E _{st} which correlates with the change in the internal energy of the solid.

So;

Q= (pVc)\theta_1 [1-e^{\dfrac {-t}{ \tau_1}}]= -\Delta E _{st}

The maximum value for the change in the internal energy of the solid  is :

(pVc)\theta_1 = -\Delta E _{st}max

By equating the two previous equation together ; we have:

\dfrac{-\Delta E _{st}}{\Delta E _{st}{max}}= \dfrac{  (pVc)\theta_1 [1-e^{\dfrac {-t}{ \tau_1}}]} { (pVc)\theta_1}

Similarly; we need to understand that the ratio of the energy storage to the maximum possible energy storage = 0.75

Thus;

0.75=  [1-e^{\dfrac {-t}{ \tau_1}}]}

So;

0.75=  [1-e^{\dfrac {-t}{ 697.79}}]}

1-0.75=  [e^{\dfrac {-t}{ 697.79}}]}

0.25 =  e^{\dfrac {-t}{ 697.79}}

In(0.25) =  {\dfrac {-t}{ 697.79}}

-1.386294361= \dfrac{-t}{697.79}

t = 1.386294361 × 697.79

t = 967.34 s

Finally; the temperature of Aluminium is determined as follows;

\dfrac{T - T _{\infty}}{T_1-T_{\infty}}= e ^ {\dfrac{-t}{\tau_t}}

\dfrac{T - 600}{25-600}= e ^ {\dfrac{-967.34}{697.79}

\dfrac{T - 600}{25-600}= 0.25

\dfrac{T - 600}{-575}= 0.25

T - 600 = -575 × 0.25

T - 600 = -143.75

T = -143.75 + 600

T = 456.25° C

Hence; the temperature of the aluminum at this time is 456.25° C

3 0
2 years ago
Explain why the fundamental software engineering principles of process, dependability, requirements management, and reuse are re
Svet_ta [14]

Answer:

1. Costs and frequency of change.

2. The most important ‘non-functional’ requirements. Different systems have different priorities for non-functional requirements.

3. The software lifetime and delivery schedule.

Explanation:

The process of requirement gathering is required in both generic and customized software.

• A document to define the development process is required in all type of software application.

• Updating is required in each type of software. For doing so, new version of each type of software is released.

• Maintenance is an important part of software development. It is required in each type of application development.

• Software has some minimum requirements to execute. So, platform dependability is considered in all software development.

5 0
2 years ago
Read 2 more answers
CHALLENGE ACTIVITY 1.4.1: Basic syntax errors. Type the statements. Then, correct the one syntax error in each statement. Hints:
Lunna [17]

Answer:

Lets check each statement for the errors.

Explanation:

System.out.println("Predictions are hard.");

This statement has no syntax errors. When this statement is executed the following line will be displayed:

Predictions are hard.

System.out.print("Especially ');

This statement is missing the closing quotation mark. A single quotation mark is placed instead of double quotation mark in the statement.

The following error message will be displayed when this program statement will be compiled:

Main.java:15: error: unclosed string literal

String literals use double quotes. So to correct this syntax error, the statement should be changed as follows:

System.out.print("Especially");

The output of this corrected line is as following:

Especially

System.out.println("about the future.").

In this line a period . is placed at the end of the statement instead of a semicolon ; but according to the syntax rules statements should end in semicolons.

The error message displayed when this line is compiled is as following:

Main.java:15: error: ; expected

Main.java:15: error: not a statement

So in order to correct this syntax error the statement should be changed as following:

System.out.println("about the future.");    

The output of this corrected line is as following:

about the future

System.out.println("Num is: " - userName);

There is a syntax error in this statement because of - symbol used instead of +

+ symbol is used to join together a variable and a value a variable and another variable in a single print statement.

The error message displayed when this line is compiled is as following:

Main.java:13: error: bad operand types for binary operator '-'

So in order to correct this syntax error the statement should be changed as following:

System.out.println("Num is: " + userName);

This line will print two things one is the string Num is and the other is the value stored in userName variable.

So let userName= 5 then the output of this corrected line is as following:

Num is: 5

8 0
2 years ago
Bananas are to be cooled from 28°C to 12°C at a rate of 1140 kg/h by a refrigerator that operates on a vapor-compression refrige
Lera25 [3.4K]

Answer:

A) COP = \frac{16.97}{9.8} = 1.731

B) P_{IN} = 0.4763

C) Second law efficiency 4.85%

exergy destruction for the cycle = 9.3237 kW

Explanation:

Given data:

T_1 = 28 degree celcius

T_2 = 12 degree celcius

\dot m = 1140 kg/h

Power to refrigerator = 9.8 kW

Cp = 3.35 kJ/kg degree C

A) Q = \dot m Cp \Delta T

        = 1140 \times 3.35\times (28-12) = 61,104 kJ/h

Q_{abs} = 61,104 kJ/h = 16.97 kJ/sec

COP = \frac{16.97}{9.8} = 1.731

b)

COP ∝ \frac{1}{P_{in}}

P_{in} wil be max when COP maximum

taking surrounding temperature T_H = 20 degree celcius

COP_{max} = \frac{T_L}{T_H- T_L} = \frac{285}{293 - 285} = 35.625

we know that

COP = \frac{heat\ obsorbed}{P_{in}}

P_{IN} = \frac{16.97}{35.62} = 0.4763

c) second law efficiency

\eta_{11} = \frac{COP_R}{(COP)_max} = \frac{1.731}{35.625} = 4.85\%

exergy destruction os given as X = W_{IN} - X_{Q2}

                                                         = 9.8 - 0.473 = 9.3237 kW

8 0
2 years ago
Other questions:
  • A 60-kg woman holds a 9-kg package as she stands within an elevator which briefly accelerates upward at a rate of g/4. Determine
    14·1 answer
  • Determine the amount of gamma and alpha phases in a 10-kg, 1060 steel casting as it is being cooled to the following temperature
    6·1 answer
  • Outline an algorithm in **pseudo code** for checking whether an array H[1..n] is a heap and determine its time efficiency.
    6·1 answer
  • Two metallic terminals protrude from a device. The terminal on the left is the positive reference for a voltage called vx (the o
    9·2 answers
  • . Were you able to observe ???? = 0 in the circuit you constructed during lab? Why or why not? Hint: What value of resistance wo
    6·1 answer
  • Fix the code so the program will run correctly for MAXCHEESE values of 0 to 20 (inclusive). Note that the value of MAXCHEESE is
    8·1 answer
  • The velocity of a particle which moves along the s-axis is given by v = 2-4t+5t^(3/2), where t is in seconds and v is in meters
    11·2 answers
  • Why is it that dislocations play an important role in controlling the mechanical properties of metallic materials, however, they
    10·1 answer
  • Consider water at 27°C in parallel flow over an isothermal, 1‐m‐long flat plate with a velocity of 2 m/s. a) Plot the variation
    15·1 answer
  • A spherical tank for storing gas under pressure is 25 m in diameter and is made of steel 15 mm thick. The yield point of the mat
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!