Project 4

due May 19

Create a web page that displays a truth table for two primitive statements, p and q, using checkboxes to indicate '1' or '0' . The code should provide the compound statement P || Q and display its truth values. The code should be designed so that one can easily replace the original compound statement with another. The code in the skeleton takes advantage of the fact that successive input devices with the same name get index numbers. We have already seen this with radio groups.

Create a second web page that has three text boxes and two buttons. When the client enters a number in base 10 in the first text box and clicks the first button, the second text box should show the same number in base 2. (Note that the second loop in the loop example posted for April 21 calculates the base 2 representation of the starting value of 'left' and stores it in 'baseTwo'.)

When the client clicks the final button on the second web page, the page should prompt the client for the bits in a base 2 number, one at a time from left to right, stopping when the client enters a value other that 0 or 1. The page should then display the base 10 representation of the number in the final text box.

Functioning pages will be demonstrated and a skeleton will be posted.

Pages performing as expected and demonstrating the required techniques will earn grades of at least 95 out of 100. Projects earn the remaining 5 points by being particularly useful, well arranged, or creative, or all three. The page must be your own work using the methods demonstrated in class. Do not use other web development tools. Do not borrow code from web pages other that class examples.

Please name the files YourLastNameproj4a.html and YourLastNameproj4b.html and email them to the matc1101 "at" cs "dot" du "dot" edu address by the beginning of class on May 19.