[perkins][lab2-2][~] mkdir Lecture7 [perkins][lab2-2][~] cd Lecture7 ####################################################### ### Demonstrating some of the operations on numbers ### ####################################################### [perkins][lab2-2][~/Lecture7] perl Numbers.pl 10 130 26 20 19 ##################################################### ### Demonstrating a program that takes lengths of ### ### two sides of a right triangle, and outputs ### ### the length of the hypotenuse. ### ##################################################### [perkins][lab2-2][~/Lecture7] perl Hypotenuse.pl Input a: 3 Input b: 4 The length of the hypotenuse is 5. The length of the hypotenuse is 5. [perkins][lab2-2][~/Lecture7] perl Hypotenuse.pl Input a: 5 Input b: 7 The length of the hypotenuse is 8.60232526704263. The length of the hypotenuse is 8.60232526704263. [perkins][lab2-2][~/Lecture7] perl Hypotenuse.pl Input a: 1 Input b: 1 The length of the hypotenuse is 1.4142135623731. The length of the hypotenuse is 1.4142135623731. [perkins][lab2-2][~/Lecture7] perl Hypotenuse.pl Input a: 1 Input b: 2 The length of the hypotenuse is 2.23606797749979. The length of the hypotenuse is 2.23606797749979. [perkins][lab2-2][~/Lecture7] perl Hypotenuse.pl Input a: ted Input b: apple The length of the hypotenuse is 0. The length of the hypotenuse is 0. [perkins][lab2-2][~/Lecture7] perl Hypotenuse.pl Input a: 3ted Input b: 4apple The length of the hypotenuse is 5. The length of the hypotenuse is 5. [perkins][lab2-2][~/Lecture7] perl Hypotenuse.pl Input a: 3ted ted3 Input b: 4 0 The length of the hypotenuse is 5. The length of the hypotenuse is 5. #################################################### ### Demonstrating the if and if-else constructs. ### #################################################### [perkins][lab2-2][~/Lecture7] perl Compare.pl Input number 1: 10 Input number 2: 20 10 is less than 20 . [perkins][lab2-2][~/Lecture7] perl Compare.pl Input number 1: 10 Input number 2: 20 10 is less than 20. [perkins][lab2-2][~/Lecture7] perl Compare.pl Input number 1: 23 Input number 2: 11 23 is greater than 11. [perkins][lab2-2][~/Lecture7] perl Compare.pl Input number 1: 23 Input number 2: 11 23 is greater than 11. [perkins][lab2-2][~/Lecture7] perl Compare.pl Input number 1: 112 Input number 2: 112 112 and 112 are equal. [perkins][lab2-2][~/Lecture7] perl Compare2.pl Input number 1: 12 Input number 2: 23 12 is less than 23. [perkins][lab2-2][~/Lecture7] perl Compare2.pl Input number 1: 34 Input number 2: 14 34 is greater than 14. [perkins][lab2-2][~/Lecture7] perl Compare2.pl Input number 1: 5 Input number 2: 5 5 and 5 are equal. ################################## ### Demonstrating a while loop ### ################################## [perkins][lab2-2][~/Lecture7] perl Countdown.pl Start count at: 7 7 6 5 4 3 2 1 0 [perkins][lab2-2][~/Lecture7] perl Countdown.pl Start count at: 500 500 499 498 ### I cut out some text here to shorten the terminal log ### 8 7 6 5 4 3 2 1 0 [perkins][lab2-2][~/Lecture7] perl Countdown.pl Start count at: 10000 10000 9999 9998 9997 ### I cut out some text here to shorten the terminal log ### 5 4 3 2 1 0 [perkins][lab2-2][~/Lecture7]