Page 203 - Open Soource Technologies 304.indd
P. 203

Unit 8: Understanding Function and Procedure



                     (c) Procedure-level
                     (d) Unbound
                  7. The highest Watch scope meaningful to a variable declared in a module using the Private
                    keyword is

                     (a) Global
                     (b) Module-level
                     (c) Procedure-level
                     (d) Indeterminate
                  8. Which statement is true about Record Maintenance?

                     (a) This utility program actually creates new tables in the Solomon database.
                     (b) This utility is used to define the following properties of a table: Name, Fields and
                        Indexes.
                     (c) This utility allows a developer to define the names of new tables. It does not actually
                        create tables in the Solomon database.
                     (d) This utility reads the actual database schema from the Solomon database and displays
                        all actual tables in that database except for MS SQL system tables.

                  9. In building your class module, you’ve been asked to make a property write-only. How can
                    you specify a write-only property for a class?
                     (a) Define a Property Set procedure without a Property Let procedure.
                     (b) Define a Property Let procedure without a Property Set procedure.

                     (c) Define a Property Let procedure without a Property Get procedure.
                     (d) You cannot make a property write-only in a Visual Basic class module.

               8.10 Review Questions

                  1. To determine the number of square centimeters of tin needed to make a tin can, add the
                    square of the radius of the can to the product of the radius and height of the can, and then
                    multiply this sum by 6.283. Write a program that requests the radius and height of a tin
                    can in centimeters as input and displays the number of square centimeters required to make
                    the tin can.
                  2. According to Plato, a man should marry a woman whose age is half his age plus seven
                    years. Write a program that requests a man’s age as input and gives the ideal age of his
                    wife.
                  3. The federal government developed the body mass index (BMI) to determine ideal weights.
                    Body mass index is calculated as 703 times the weight in pounds, divided by the square
                    of the height in inches, and then rounded to the nearest whole number. Write a program
                    that accepts a person’s weight and height as input and gives the person’s body mass index.
                    Note: A BMI of 19 to 25 corresponds to a healthy weight.
                  4. In order for exercise to be beneficial to the cardiovascular system, the heart rate (number
                    of heart beats per minute) must exceed a value called the training heart rate, THR. A


                                      LOVELY PROFESSIONAL UNIVERSITY                        197
   198   199   200   201   202   203   204   205   206   207   208