CSci 4608 Problem set 2: forms, Perl

Problem 1

Write an HTML page with a registration form that asks the user to submit the following information: Validate the form in the following way: Write the perl script to check the user information (the same way you have validate it), except for the password. If it is entered correctly, display it. Otherwise print the error message (which fields have not been entered correctly). Note that you cannot assume the that the state is among those given as options, so you need to check that, too. Make sure it's reasonably formatted (each piece of information clearly marked and displayed on its own line).

Problem 2

Write an HTML page with a form for electronic voting. It should have at least three options, the user can vote for exactly one of them (use validation to guarantee that at least one option is selected, and use a group of radio buttons so that the selection is mutually exclusive).

Write a Perl script which will keep record of the votes in a text file. When a vote arrives, it is added to the file. Then the results are displayed as numbers and as color bars. To set up the color bars, use tables (one per each voting option) with the background of the cells representing the option. Each table has just one row. The width of the table is set based on the number of votes. Here is an example of what the tables might look like (only you will need to set the width in the perl program based on the number of votes).

Votes for Bart Simpson:
Votes for Lisa Simpson:
Votes for Maggie Simpson:

Problem 3

Please answer the following questions. Explain your answers, give examples if needed.

This is a problem set from CSci 4608 course at UMM.

The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.