Page 112 - Computer_Genius_v2.1_C7_flipbook
P. 112
By combining coding with science, we can perform multiple operations that human beings cannot do
like easily, like complex calculations.
Temperature
The degree of hotness and coldness of a body is called temperature of body.
Thermometer is an instrument used to measure temperature. It works on the principle of expansion
in liquid on heating.
It is measured in Celsius and Fahrenheit scale but for scientific work Kelvin scale is used.
Clinical Thermometer
The thermometer that measures our body temperature is called
a clinical thermometer. A clinical thermometer consists of a long,
narrow, uniform glass tube. It has a bulb at one end. This bulb contains
mercury.
Program to Know the Room Temperature
To create an AI Connect program to know the room temperature, create a project. In this project
create a Basic Coding activity. Then follow the given steps:
Conditions that are used here:
l If temperature is greater than 25, print “It's too hot”.
l If temperature is less than 25, print “It's too cold”.
l If temperature is 25, print “It's perfect!”
l If no input, print invalid.
Step 1 Create a variable “T” and ask the user to enter the room temperature .
Block Code
Textual code
Step 2 Using the ‘logic’ blocks, provide the conditions to detect and give print accordingly.
The elif keyword is python’s way of saying , if the previous conditions were not true, then
try this condition. It is equivalent to else if block in AI Connect.
110 Computer Genius (V2.1)-VII

