CS 100

Introduction to Computer Science

Lab 4

PERL: conditional execution & loops

Due:  April 17/18 at midnight

 

 

 

 

 

Task 1: Write a program to display the following graphs on the screen.

(You are required to use “for” loops instead of multiple print commands in lab 3.)

 

(1)

 

########

 ########

  ########

   ########

########

 ########

  ########

   ########

 

(2)

 

#

##

###

####

#####

######

#######

########

#########

##########

 

 

Task 2: Write a program to take 10 numbers from users via keyboard

and output the maximum and the minimum.

 

 

 

 

 

How to submit your programs?

 

Please email your programs for the tasks to Jasper Lin by the due date. His email address is jlin@mtholyoke.edu.

Make sure you codes work correctly before you submit them.

 

Grading:

 

 

Program for task 1 (Proper use of the for loops)

20 points

Program for task 2 (Proper use of arrays and the loops)

20 points

Overall Readability of the codes (comments, indenting of code blocks, descriptive variable names, etc.)

10 points