Assessment to Graham Etherington's While Concept Map

May 9, 2014 • Alexandra Simperler

Question 1:

The following PERL script

$number = 0;

while ($number < 5) {

    $number += 1;

    print “The count is now $numbern”;

}

prints which last line?

A)     The count is now 4

B)      The count is now 5

C)      “The count is now 5”

D)     The count is now 6

 

Exercise 1:

Change the script so only odd numbers up to11 are printed.