Home | | | Syllabus | | | Schedule | | | Class Notes | | | Assignments |
Assignment goal: To be able to identify and manipulate different data types in Perl.
Assignment structure: Write one Perl program that uses variables for at least three data types: string, integer and floating point number. The program should perform a basic operation with each variable, to produce a new value. For example, concatonate a new string or identify a substring; add integers; take the square root of a floating point number.
Required input and output: No required input. Output should be the original variables and the new variables.
Further work: Optionally, you could solicit user input from the terminal or a file, and let the user select different types of operations for different data types. Optionally, you could identify the data type at run time (for example, by seeing whether a variable includes letters, or may be multiplied).
Deliverables: Send email to Prof. Newby with two attachments. First is your Perl program. Second is a plain text file showing a sample run of the program.
Grading: 10 points for required functionality, plus up to 2 points for extra functionality, as follows:
Criterion | Max. Points | Description |
Functionality | 6 | Meets assignment I/O requirements |
Legibility | 2 | Includes comments; neatly written |
Parsimony | 2 | Uses appropriate data structures and syntax; not overly complex or convoluted |
Extra work | 2 | Functionality demonstrating clear understanding beyond the assignment requirements |