Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CODE MUST BE IN PYTHON 3!!! You have a thermostat that allows you to set the room to any temperature between 40 and 89 degrees.

CODE MUST BE IN PYTHON 3!!!

You have a thermostat that allows you to set the room to any temperature between 40 and 89 degrees.

The thermostat can be adjusted by turning a circular dial. For instance, if the temperature is set to 50 degrees and you turn the dial 10 clicks toward the left, you will set the temperature to 40 degrees. But if you keep turning 1 click to the left (represented as -1) it will circle back around to 89 degrees. If you are at 40 degrees and turn to the right by one click, you will get 41 degrees. As you continue to turn to the right, the temperature goes up, and the temperature gets closer and closer to 89 degrees. But as soon as you complete one full rotation (50 clicks), the temperature cycles back around to 40 degrees.

Write a program that calculates the temperature based on how much the dial has been turned. The number of clicks (from the starting point of 40 degrees) is contained in a variable. You should print the current temperature for each given click variable so that your output is as follows:

Each output should be on it own line!

The temperature is 40 The temperature is 89 The temperature is 64 The temperature is 41 The temperature is 89 The temperature is 40

Coding Instructions:

#For each click variable, calculate the temperature and print it as shown in the instruction

click_1 = 0

# TODO calculate the temperature, and report it back to the user

click_2 = 49

# TODO calculate the temperature, and report it back to the user

click_3 = 74

# TODO calculate the temperature, and report it back to the user

click_4 = 51

# TODO calculate the temperature, and report it back to the user

click_5 = -1

# TODO calculate the temperature, and report it back to the user

click_6 = 20

# TODO calculate the temperature, and report it back to the use

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Pinpoint your needs for improvement in interpersonal relations.

Answered: 1 week ago

Question

Which are true about the pipe character in a windows command line

Answered: 1 week ago

Question

Write a note on The Sacrifice of Abraham.

Answered: 1 week ago

Question

The Functions of Language Problems with Language

Answered: 1 week ago

Question

The Nature of Language

Answered: 1 week ago