Name two advantages of server-side scripting as opposed to client-side scripting (as typified by PHP versus JavaScript).
trustedcomputers, they can be configured to access sensitive information, such as account information.
Complete the below XHTML code so that the Web page displays the following.
Note
This problem is rather easy.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>A simple problem</title> </head>
<body> <h1>Note</h1> <p><em>This</em> problem is rather easy.</p> </body> </html>
How many bits in a byte? How many bytes are in a kilobyte of memory?
A byte contains 8 bits, and a kilobyte contains 210 bytes (which is 1,024 bytes).
What is ASCII?
ASCII is a system that associates a different seven-bit sequence with each character that can be entered on a standard U.S. keyboard.
Perform each of the following conversions.
a. | 101101(2) | to decimal |
b. | 1010101(2) | to decimal |
c. | 23(10) | to binary |
d. | 95(10) | to binary |
a. | 101101(2) | is 45(10) |
b. | 1010101(2) | is 85(10) |
c. | 23(10) | is 10111(2) |
d. | 95(10) | is 1011111(2) |
Perform each of the following conversions.
a. | 1010101(2) | to octal |
b. | 1010101(2) | to hexadecimal |
c. | 101101(2) | to hexadecimal |
d. | 560(8) | to binary |
e. | CAB(16) | to binary |
f. | 1B2(16) | to binary |
a. | 1 010 101(2) | is 125(8) |
b. | 101 0101(2) | is 55(16) |
c. | 10 1101(2) | is 2D(16) |
d. | 560(8) | is 101 110 000(2) |
e. | CAB(16) | is 1100 1010 1011(2) |
f. | 1B2(16) | is 1 1011 0010(2) |
Suppose we are using a computer that represents integers using two's-complement representation over eight-bit words. How would our computer represent each of the following integers?
a. | 0(10) |
b. | 42(10) |
c. | −42(10) |
d. | −120(10) |
a. | 0(10): | 0000 0000 |
b. | 42(10): | 0010 1010 |
c. | −42(10): | 1101 0110 |
d. | −120(10): | 1000 1000 |
Describe each of the following colors in English, explaining why that code translates to the color you describe.
a. #B000FF
b. #A08080
Suppose we have the following HTML form, which displays three text fields and a button.
<form method="post" action="range.php"> <p><input type="input" name="first" /></p> <p><input type="input" name="second" /></p> <p><input type="input" name="third" /></p> <p><input type="submit" value="Compute" /></p> </form>
Complete the following PHP file so that it displays the
smallest and largest of the numbers entered by the user.
For example, if the user enters 7, 4, and 1776,
range.php should respond with The numbers are
between 4 and 1776.
To accomplish this, you should use the min and
max functions built into PHP, both of which can take
any number of parameters and return the minimum (for
min) or the maximim (for max) among them.
(Your PHP script should not verify that the inputs are valid
numbers.)
<?php import_request_variables("pg", "form_"); ?> <html> <head> <title>Range among three</title> </head> <body>
<p>The numbers are between <?php echo min($form_first, $form_second, $form_third); ?> and <?php echo max($form_first, $form_second, $form_third); ?>.</p> </body> </html>
Suppose we have the following HTML form, which displays two text fields and a button.
<form method="post" action="geom.php"> <p><input type="input" name="a" /></p> <p><input type="input" name="b" /></p> <p><input type="submit" value="Compute" /></p> </form>
Complete the following PHP file so that it displays the geometric mean of the numbers the user types in the text fields. The geometric mean of two numbers is the square root of their product; for example, the geometric mean of 4 and 9 is 6, since that is the square root of 4 times 9. (Your PHP script should not verify that the inputs are valid numbers.)
<?php import_request_variables("pg", "form_"); ?> <html> <head> <title>Geometric Mean</title> </head> <body> <p>The answer is:
<?php echo sqrt($form_a * $form_b); ?>.</p> </body> </html>