Question

In: Computer Science

* Read the high value. > 1- First, initialize the constant NUMS as 3: NUMS=3 2-...

* Read the high value.

>

  1. 1- First, initialize the constant NUMS as 3: NUMS=3

    2- Print the title of the application.

    >---=== Python Temperature Analyzer ===---<.

  2. 3- Using a for loop, prompt the user to enter the high and low values for each of NUMS days. The values entered must be between -40 and 40, and high must be greater than low.

    Print the following messages:

    >

Enter the high value for day 1:

< (or day 2, or day 3)

Enter the low value for day 1:

< (or day 2, or day 3)

* Read the low value.
IMPORTANT: You may only declare two (2) int type variables for the high and low values

4- Useanestedwhile(ordo-while)looptoanalyzetheresults,highmustbegreaterthan low, high must be less than 41, low must be greater than -41

*If any entry is incorrect, prompt the user to enter again until the entries pass the tests:

>
<

Then prompt again for the high and low temperatures for the day.

OUTPUT EXAMPLE (Red numbers show the input)

--== Python Temperature Analyzer ==-- Enter the high value for day 1: 8

Enter the low value for day 1: -2

Enter the high value for day 2: 41

Enter the low value for day 2: -4

Incorrect values, temperatures must be in the range -40 to 40, high must be greater than low.

Enter the high value for day 2: 9

Enter the low value for day 2: -4

Enter the high value for day 3: 5

Enter the low value for day 3: 11

Incorrect values, temperatures must be in the range -40 to 40, high must be greater than low.

Enter the high value for day 3: 11 Enter the low value for day 3: 5

Solutions

Expert Solution

Language : Python

Code :

x = 3 #number of days

i = 1 #takes count in loop for days

while(i<=x): #while i is smaller or equals than x
high = int(input("Enter the high value for day {} ".format(i))) #taking user input for high
low = int(input("Enter the low value for day {} ".format(i))) #taking user input for low
if(high>=41 or low<=-41 or high<=low): #if high is >= 41 or low is <=-41 or high is smaller than low than print error and take input for same day
print("Incorrect values, temperatures must be in the range -40 to 40, high must be greater than low.")
else:
i+=1 #else increment the day
  
  


Output :

Execution Screenshot :


Related Solutions

> * Read the high value. > 1- First, initialize the constant NUMS as 3: NUMS=3...
> * Read the high value. > 1- First, initialize the constant NUMS as 3: NUMS=3 2- Print the title of the application. >---=== Python Temperature Analyzer ===---< Enter the high value for day 1: < (or day 2, or day 3) Enter the low value for day 1: < (or day 2, or day 3) 3- Using a for loop, prompt the user to enter the high and low values for each of NUMS days. The values entered must...
PYTHON 1- First, initialize the constant NUMS as 3: NUMS=3 2- Print the title of the...
PYTHON 1- First, initialize the constant NUMS as 3: NUMS=3 2- Print the title of the application. >---=== Python Temperature Analyzer ===---< 3- Using a for loop, prompt the user to enter the high and low values for each of NUMS days. The values entered must be between -40 and 40, and high must be greater than low. Print the following messages: > * Read the high value. > Enter the high value for day 1: < (or day 2,...
solve the first order equation with initial value y’ +3/4y = x^6,; y(1) =2
solve the first order equation with initial value y’ +3/4y = x^6,; y(1) =2
1)A reaction(A-products) is found to be first order with a rate constant of 2.97*10^-3 / min....
1)A reaction(A-products) is found to be first order with a rate constant of 2.97*10^-3 / min. What is the half life for this reaction? 2) If the reaction described in probrem 1 starts with an initial concentration of 1.00M of reactant A, What is the concentration of A after 300min? 3) What is the reaction oreder and what is the value of the rate constant? IN(H2O2) y=0.00835x-0.00493 1/H2O2 y=0.00460x-0.847 H2O2 y=-0.000264x+0.841
Given the following frequency distribution, the distribution is: Value Frequency 1 1 2 2 3 3...
Given the following frequency distribution, the distribution is: Value Frequency 1 1 2 2 3 3 15 10 16 15 17 20 18 40 19 20 20 10 Answer: Which one it is? Normal. Positively skewed. Negatively skewed. Bimodal
1 = Derivative of a Constant; 2 = Power Rule; 3 = Product Rule; 4 =...
1 = Derivative of a Constant; 2 = Power Rule; 3 = Product Rule; 4 = Quotient Rule; 5 = Derivative of Exponential Function; 6 = Derivative of Logarithmic Function; 7 = Chain Rule 1. Circle the number(s) indicating the rule(s) used to find the derivative of each function. Then differentiate the function. (a.) f(x) = ln7 1 2 3 4 5 6 7 (b.) p(y) = y3.7 1 2 3 4 5 6 7 (c.) g(x) = √x2ex 1...
first matrix A [ 2 -1 3 ] [-4 0 -2 ] [2 -5 12 ]...
first matrix A [ 2 -1 3 ] [-4 0 -2 ] [2 -5 12 ] [4 0 4 ] amd b [2] [-2] [5] [0] solve for Ax=b using tan LU factorization of A
Assume that in Country X, the velocity of money is constant. Read GDP grows at 2%...
Assume that in Country X, the velocity of money is constant. Read GDP grows at 2% per year and the money stock grows at 10% per year. Let’s assume further that the nominal interest rate is equal to 12%. a. What is the growth rate of nominal GDP? b. What is the inflation rate? c. What is the real interest rate? What equations do you use to solve the following questions, please provide formulas of how it was set up...
We have 3 bowls, 1) The first bowl contains 3 red and 2 green balls 2)...
We have 3 bowls, 1) The first bowl contains 3 red and 2 green balls 2) the second bowl contains 2 red and 1 white balls 3) the third one contains 1 red and 3 green balls One bowl by the random is selected and then 2 balls will be drawn. what is the probability that both of these balls will be red?
We have 3 bowls, 1) The first bowl contains 3 red and 2 green balls 2)...
We have 3 bowls, 1) The first bowl contains 3 red and 2 green balls 2) the second bowl contains 2 red and 1 white balls 3) the third one contains 1 red and 3 green balls One bowl by the random is selected and then 2 balls will be drawn. what is the probability that both of these balls will be red?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT