Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in python, please help Exercise 2 This exercise is about temperature measurements over a period of days. a) Start by creating a simple code that
in python, please help
Exercise 2 This exercise is about temperature measurements over a period of days. a) Start by creating a simple code that asks for a number of days to run the experiment then asks the user to enter the temperatures for the different days. Use a while loop for this exercise. See sample run below: Enter the number of days of the experiment: 3 Enter a temperature: 42 Enter a temperature: 15 Enter a temperature: 25 End of the experiment. b) Modify the program so that it displays the day index (day 1 , day 2 ) in the question. See below sample run: Enter the number of days of the experiment: 3 Enter the temperature of day 1:42 Enter the temperature of day 2:15 Enter the temperature of day 3:25 End of the experiment. c) Add input validation by checking that the temperature entered is actually a floating point number and does not contain other characters. In case there is an error an alert message should be displayed and the measurement entered again. See below sample run: Enter the number of days of the experiment: 3 Enter the temperature of day 1:42.5 Enter the temperature of day 2 : 12.1 Enter the temperature of day 3 : ten Be careful, you entered an incorrect value for the temperature. Enter the temperature of day 3 : 10 End of the experiment Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started