Page 112 - Computer Genius Class 07
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 is work on principle of expansion in

                  liquid on heating.
                   t is measured in  elsius and Fahrenheit scale  ut  or scientific  or   el in 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-VII
   107   108   109   110   111   112   113   114   115   116   117